Code Monkey home page Code Monkey logo

apple_manifest_rails's Introduction

AppleManifestRails

Mountable Rails engine for capturing iOS UDID, check if IPA is installable, and installing if so.

Created for a Rails 3.2 app, might work in Rails 4, but I haven't tried. Let me know if it works!

Configuration

By default, the engine assumes the following directory structure in your rails project:

rails_application/
  app/
  config/
  ...
  mobile_build/              <------------- config.template_dir
    manifest.plist
    Profile.mobileconfig

The app.ipa file is the actual compiled binary archive from Xcode. The engine will look at the embedded.mobileprovision to check if the client is installable.

Important Info

The plist and mobileconfig files are part of the UDID capture and install processes, they are templates that will be modified before being sent to the client. See the templates directory for what these files need to look like. Customize them to your liking and make sure they exist where expected.

The engine will not work without these.

Custom Initializer

Optionally, you can override these defaults by setting up an initializer in your rails app, e.g. config/initializers/apple_manifest_rails.rb

AppleManifestRails.configure do |config|
  config.page_title = "Who needs testflight? I've got apple_manifest_rails!"
  config.template_dir = Rails.root.join('apple_manifest_rails', 'templates')

  # The DB Table that contains the model for the iPhone apps.
  config.model = IphoneApp
end

Install

Step 1: Add to your rails gemfile

gem 'apple_manifest_rails'

Step 2: bundle install

Step 3: Mount the engine in config/routes.rb

Example::Application.routes.draw do
  mount AppleManifestRails::Engine => '/'
end

Step 5: Create the model. TODO, need to supply a generator

class IphoneApp < ActiveRecord::Base
  has_attached_file :file  # Paperclip

  def file_path     # Required method by apple_manifest_rails
    file.path
  end
end

Migration:

class CreateIphoneApps < ActiveRecord::Migration
  def change
    create_table :iphone_apps do |t|
      t.string :version
      t.string :uuid
      t.attachment :file
      t.string :name

      t.timestamps null: false
    end
  end
end

Step 5: Start your rails server and navigate iOS Safari to /enroll/:uuid or /install/:uuid (aliased)

Contributing

Yeah! Fork it, make it better! I know there are others out there that dislike relying on Testflight and Hockeyapp too -- that functionality can just be a mountable engine!

License

MIT or WTFPL

apple_manifest_rails's People

Contributors

scottconrad avatar kfatehi avatar miio avatar

Watchers

Scott Montgomerie avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.