helios 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec8e7e4600d587e9ffb3c1c96a93e371c9000126
4
- data.tar.gz: 6062579b3e86cdf248881d5785ac9679c240285f
3
+ metadata.gz: 402e29639eacaa1ba54ba2f4eccefb1ac228be91
4
+ data.tar.gz: c2f8542dd3218c7a2b97c75aeea6a0cec5c57f76
5
5
  SHA512:
6
- metadata.gz: 493b0388cfaa239908e63bfd07b8ec900c89ecd463f59382f7e83a93cd17f78bc970cd204f0beee710649a17da0fc986bf2491997ba1dc1ae7b1ad52a558ebad
7
- data.tar.gz: debfe1d63f7497d469afc5ae59cc8a4ad9ec9eea26c150c4f1bc31ad410c2a10a11cbb19d3032e26b268c46dc181c2d53f628d2f96645b7662d166c811746a62
6
+ metadata.gz: 4bfd61221daf7968ccba1a273930dfc0787610ce175e2d2cc0fab8e30fa7828b27c30810d8acf0597e9f5d09239b9ca6d974ad46c3017eb76b758bc214bae877
7
+ data.tar.gz: 2f8bb05d75f2bef9f6b4fb1f308aa7741bba846a6292aeb6be94b2c58e60d9e1199d919dc8afc838d68e179af1ad39795d60ea370c3daf3bd09376e68750a8d5
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helios (0.2.0)
4
+ helios (0.2.1)
5
5
  coffee-script (~> 2.2)
6
6
  commander (~> 4.1)
7
7
  compass (~> 0.12)
8
- foreman (~> 0.60)
9
- haml (~> 3.1)
8
+ foreman (~> 0.63)
9
+ haml (>= 3.1)
10
10
  json (~> 1.7)
11
11
  rack-contrib (~> 1.1)
12
12
  rack-core-data (~> 0.3)
@@ -15,12 +15,12 @@ PATH
15
15
  rack-push-notification (~> 0.4)
16
16
  rails-database-url (~> 1.0)
17
17
  sinatra (~> 1.3)
18
- sinatra-assetpack (~> 0.1)
18
+ sinatra-assetpack (~> 0.1.7)
19
19
  sinatra-backbone (~> 0.1.0.rc2)
20
20
  sinatra-contrib (~> 1.3)
21
21
  sinatra-param (~> 0.1)
22
22
  sinatra-support (~> 1.2)
23
- zurb-foundation (~> 4.0)
23
+ zurb-foundation (= 4.1.2)
24
24
 
25
25
  GEM
26
26
  remote: https://rubygems.org/
@@ -28,7 +28,7 @@ GEM
28
28
  activesupport (3.2.13)
29
29
  i18n (= 0.6.1)
30
30
  multi_json (~> 1.0)
31
- backports (3.1.1)
31
+ backports (3.3.0)
32
32
  chunky_png (1.2.8)
33
33
  coffee-script (2.2.0)
34
34
  coffee-script-source
@@ -40,16 +40,18 @@ GEM
40
40
  chunky_png (~> 1.2)
41
41
  fssm (>= 0.2.7)
42
42
  sass (~> 3.1)
43
- diff-lcs (1.2.2)
43
+ diff-lcs (1.2.4)
44
+ dotenv (0.7.0)
44
45
  eventmachine (1.0.3)
45
- excon (0.17.0)
46
46
  execjs (1.4.0)
47
47
  multi_json (~> 1.0)
48
- foreman (0.62.0)
48
+ foreman (0.63.0)
49
+ dotenv (>= 0.7)
49
50
  thor (>= 0.13.6)
50
51
  fssm (0.2.10)
51
- haml (3.1.8)
52
- highline (1.6.16)
52
+ haml (4.0.2)
53
+ tilt
54
+ highline (1.6.18)
53
55
  houston (0.1.1)
54
56
  commander (~> 4.1.2)
55
57
  json (~> 1.7.3)
@@ -98,40 +100,39 @@ GEM
98
100
  rspec-core (2.13.1)
99
101
  rspec-expectations (2.13.0)
100
102
  diff-lcs (>= 1.1.3, < 2.0)
101
- rspec-mocks (2.13.0)
102
- sass (3.2.7)
103
- sequel (3.45.0)
104
- sinatra (1.3.6)
105
- rack (~> 1.4)
106
- rack-protection (~> 1.3)
107
- tilt (~> 1.3, >= 1.3.3)
103
+ rspec-mocks (2.13.1)
104
+ sass (3.2.8)
105
+ sequel (3.46.0)
106
+ sinatra (1.4.2)
107
+ rack (~> 1.5, >= 1.5.2)
108
+ rack-protection (~> 1.4)
109
+ tilt (~> 1.3, >= 1.3.4)
108
110
  sinatra-assetpack (0.1.7)
109
111
  jsmin
110
112
  rack-test
111
113
  sinatra
112
114
  tilt (>= 1.3.0)
113
- sinatra-backbone (0.1.0.rc2)
115
+ sinatra-backbone (0.1.1)
114
116
  sinatra
115
- sinatra-contrib (1.3.2)
117
+ sinatra-contrib (1.4.0)
116
118
  backports (>= 2.0)
117
119
  eventmachine
118
120
  rack-protection
119
121
  rack-test
120
- sinatra (~> 1.3.0)
122
+ sinatra (~> 1.4.2)
121
123
  tilt (~> 1.3)
122
- sinatra-param (0.1.2)
124
+ sinatra-param (0.1.3)
123
125
  sinatra (~> 1.3)
124
126
  sinatra-support (1.2.2)
125
127
  sinatra (>= 1.0)
126
128
  terminal-table (1.4.5)
127
129
  thor (0.18.1)
128
- tilt (1.3.6)
129
- venice (0.0.1)
130
- commander (~> 4.1.2)
131
- excon (~> 0.17.0)
132
- json (~> 1.7.3)
133
- terminal-table (~> 1.4.5)
134
- zurb-foundation (4.0.9)
130
+ tilt (1.3.7)
131
+ venice (0.1.0)
132
+ commander (~> 4.1)
133
+ json
134
+ terminal-table (~> 1.4)
135
+ zurb-foundation (4.1.2)
135
136
  sass (>= 3.2.0)
136
137
 
137
138
  PLATFORMS
data/README.md CHANGED
@@ -17,21 +17,37 @@ Helios also comes with a Web UI. Browse and search through all of your database
17
17
  - Ruby 1.9
18
18
  - PostgreSQL 9.1 _([Postgres.app](http://postgresapp.com) is the easiest way to get a Postgres server running on your Mac)_
19
19
 
20
- ## Getting Started
20
+ ## Getting Started on OS X
21
21
 
22
- 1. Install Helios at the command prompt:
22
+ 1. Verify Ruby Installation:
23
23
 
24
- $ gem install helios
24
+ `$ ruby -v`
25
25
 
26
- 2. Create a new Helios application:
26
+ > If you do not see `ruby 1.9.x` printed, we suggest installing [RVM](http://rvm.io) to manage Ruby versions.
27
27
 
28
- $ helios new myapp
28
+ 2. Install Helios at the command prompt:
29
29
 
30
- 3. Change directory to `myapp` and start the web server:
30
+ `$ gem install helios`
31
31
 
32
- $ cd myapp; helios server
32
+ 3. Create a new Helios application:
33
33
 
34
- 4. Go to http://localhost:5000/admin and you’ll see your app's Web UI
34
+ `$ helios new myapp`
35
+
36
+ 3. Create a Postgres database at the command prompt:
37
+
38
+ `$ createdb -h localhost myapp`
39
+
40
+ > Database credentials are read from the `.env` file generated by Helios, as the variable `DATABASE_URL`. By default, this will point to a database with the name of the generated app.
41
+
42
+ 4. Change directory to `myapp`
43
+
44
+ `$ cd myapp`
45
+
46
+ 5. Start the web server:
47
+
48
+ `$ helios server`
49
+
50
+ 6. Go to [http://localhost:5000/admin](http://localhost:5000/admin) and you’ll see your app's Web UI
35
51
 
36
52
  Read on for instructions on the following:
37
53
 
@@ -59,11 +75,11 @@ require 'bundler'
59
75
  Bundler.require
60
76
 
61
77
  run Helios::Application.new do
62
- service :data, model: 'path/to/DataModel.xcdatamodel'
63
- service :push_notification
64
- service :in_app_purchase
65
- service :passbook
66
- end
78
+ service :data, model: 'path/to/DataModel.xcdatamodel'
79
+ service :push_notification
80
+ service :in_app_purchase
81
+ service :passbook
82
+ end
67
83
  ```
68
84
 
69
85
  ### Rails
@@ -126,7 +142,7 @@ Each entity in the specified data model will have a `Sequel::Model` subclass cre
126
142
  </tr>
127
143
  <tr>
128
144
  <td><tt>DELETE /:resources/:id</tt></td>
129
- <td>Delege the specified resource instance</td>
145
+ <td>Delete the specified resource instance</td>
130
146
  </tr>
131
147
  </table>
132
148
 
@@ -269,7 +285,7 @@ Once you've installed the [Heroku Toolbelt](https://toolbelt.heroku.com), and ha
269
285
  $ heroku create
270
286
  $ git push heroku master
271
287
 
272
- ## Integrating with iOS Application
288
+ ## Integrating with an iOS Application
273
289
 
274
290
  ### Core Data Synchronization
275
291
 
@@ -279,6 +295,8 @@ See ["Building an iOS App with AFIncrementalStore and the Core Data Buildpack"](
279
295
 
280
296
  ### Push Notification Registration
281
297
 
298
+ With [Orbiter](https://github.com/mattt/Orbiter) you can integrate Push Notifications into your app easily.
299
+
282
300
  ```objective-c
283
301
  - (void)application:(UIApplication *)application
284
302
  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
@@ -293,6 +311,18 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
293
311
  }
294
312
  ```
295
313
 
314
+ ## Coming Attractions
315
+
316
+ There's still a lot to do to make Helios even better. Here are some ideas that are at the top of the list:
317
+
318
+ - Test coverage
319
+ - More documentation
320
+ - More example projects
321
+ - Better RubyMotion integration
322
+ - Support for multiple schema definitions (not just Core Data)
323
+ - Send push notifications from the UI
324
+ - Support for additional platforms (Android, WP7)
325
+
296
326
  ---
297
327
 
298
328
  ## Contact
data/Rakefile CHANGED
@@ -7,5 +7,4 @@ task :build => "#{gemspec.full_name}.gem"
7
7
 
8
8
  file "#{gemspec.full_name}.gem" => gemspec.files + ["helios.gemspec"] do
9
9
  system "gem build helios.gemspec"
10
- system "gem install helios-#{Helios::VERSION}.gem"
11
10
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.description = "Helios is an open-source framework that provides essential backend services for iOS apps, from data synchronization and user accounts to push notifications, in-app purchases, and passbook integration. It allows developers to get a client-server app up-and-running in just a few minutes, and seamlessly incorporate functionality as necessary."
15
15
 
16
16
  s.add_dependency "commander", "~> 4.1"
17
- s.add_dependency "foreman", "~> 0.60"
17
+ s.add_dependency "foreman", "~> 0.63"
18
18
  s.add_dependency "rack-contrib", "~> 1.1"
19
19
  s.add_dependency "rack-core-data", "~> 0.3"
20
20
  s.add_dependency "rack-push-notification", "~> 0.4"
@@ -24,13 +24,13 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency "coffee-script", "~> 2.2"
25
25
  s.add_dependency "sinatra", "~> 1.3"
26
26
  s.add_dependency "sinatra-contrib", "~> 1.3"
27
- s.add_dependency "sinatra-assetpack", "~> 0.1"
27
+ s.add_dependency "sinatra-assetpack", "~> 0.1.7"
28
28
  s.add_dependency "sinatra-backbone", "~> 0.1.0.rc2"
29
29
  s.add_dependency "sinatra-param", "~> 0.1"
30
30
  s.add_dependency "sinatra-support", "~> 1.2"
31
- s.add_dependency "haml", "~> 3.1"
31
+ s.add_dependency "haml", ">= 3.1"
32
32
  s.add_dependency "compass", "~> 0.12"
33
- s.add_dependency "zurb-foundation", "~> 4.0"
33
+ s.add_dependency "zurb-foundation", "4.1.2"
34
34
  s.add_dependency "rails-database-url", "~> 1.0"
35
35
 
36
36
  s.add_development_dependency "rake", ">= 0"
@@ -1,10 +1,10 @@
1
1
  require 'rack'
2
2
 
3
3
  module Helios
4
- class Helios::Application
4
+ class Application
5
5
  def initialize(app = nil, options = {}, &block)
6
6
  map = {}
7
- map['/'] = Helios::Backend.new(&block)
7
+ map['/'] = Rack::Cascade.new([app, Helios::Backend.new(&block)].compact)
8
8
  map['/admin'] = Helios::Frontend.new if options.fetch(:frontend, true)
9
9
 
10
10
  @app = Rack::URLMap.new(map)
@@ -14,8 +14,6 @@ class Helios::Backend::Data < Sinatra::Base
14
14
  content_type :json
15
15
  end
16
16
 
17
- helpers Sinatra::Param
18
-
19
17
  options '/' do
20
18
  pass unless self.class < Helios::Administerable
21
19
 
@@ -4,13 +4,11 @@ command :console do |c|
4
4
 
5
5
  c.action do |args, options|
6
6
  require 'irb'
7
- require 'foreman/env'
7
+ require 'dotenv'
8
8
  require 'sequel'
9
9
 
10
10
  @env = {}
11
- Foreman::Env.new(".env").entries do |name, value|
12
- @env[name] = value
13
- end
11
+ @env.update Dotenv::Environment.new(".env")
14
12
 
15
13
  Sequel.connect(@env['DATABASE_URL'])
16
14
 
@@ -1,8 +1,14 @@
1
+ require 'dotenv'
2
+ require 'sequel'
3
+
1
4
  command :server do |c|
2
5
  c.syntax = 'helios server'
3
6
  c.summary = 'Start running Helios locally'
7
+ c.option '-w', "--[no-]warn", "Warn about possible database issues"
4
8
 
5
9
  c.action do |args, options|
10
+ validate_database_settings! unless options.warn == false
11
+
6
12
  begin
7
13
  exec 'foreman start'
8
14
  rescue => exception
@@ -14,3 +20,30 @@ end
14
20
  alias_command :s, :server
15
21
  alias_command :start, :server
16
22
  alias_command :launch, :server
23
+
24
+ private
25
+
26
+ def validate_database_settings!
27
+ Dotenv.load
28
+
29
+ say_error "DATABASE_URL environment variable not set in .env or in Rails config/database.yml" and abort if ENV['DATABASE_URL'].nil?
30
+
31
+ begin
32
+ db = Sequel.connect(ENV['DATABASE_URL'])
33
+ db.test_connection
34
+ rescue Sequel::DatabaseConnectionError => error
35
+ say_warning %{Error connecting to database: "#{error.message.strip}"}
36
+ case error.message
37
+ when /database "(.+)" does not exist/
38
+ if agree "Would you like to create this database now? (y/n)"
39
+ uri = URI(db.uri)
40
+ host, database = uri.host, uri.path.delete("/")
41
+
42
+ log 'createdb', database
43
+ system "createdb -h #{host} #{database}"
44
+ end
45
+ else
46
+ abort unless agree "Continue starting Helios? (y/n)"
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module Helios
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-02 00:00:00.000000000 Z
11
+ date: 2013-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0.60'
33
+ version: '0.63'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0.60'
40
+ version: '0.63'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-contrib
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: '0.1'
173
+ version: 0.1.7
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: '0.1'
180
+ version: 0.1.7
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: sinatra-backbone
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -224,14 +224,14 @@ dependencies:
224
224
  name: haml
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ~>
227
+ - - ! '>='
228
228
  - !ruby/object:Gem::Version
229
229
  version: '3.1'
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ~>
234
+ - - ! '>='
235
235
  - !ruby/object:Gem::Version
236
236
  version: '3.1'
237
237
  - !ruby/object:Gem::Dependency
@@ -252,16 +252,16 @@ dependencies:
252
252
  name: zurb-foundation
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ~>
255
+ - - '='
256
256
  - !ruby/object:Gem::Version
257
- version: '4.0'
257
+ version: 4.1.2
258
258
  type: :runtime
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - ~>
262
+ - - '='
263
263
  - !ruby/object:Gem::Version
264
- version: '4.0'
264
+ version: 4.1.2
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: rails-database-url
267
267
  requirement: !ruby/object:Gem::Requirement