wd_sinatra 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,11 @@
1
1
  # Weasel Diesel Sinatra Changelog
2
2
 
3
+ ## 1.0.4
4
+ * Minor change to the Rakefile to support the new
5
+ `wd_sinatra_active_record` gem.
6
+ * Calling `WDSinatra::AppLoader.set_loadpath` now requires a root path
7
+ (used to be optional) and sets the app's root path if not set already.
8
+
3
9
  ## 1.0.3
4
10
  * Bug release due to a problem with requiring the new `WSList
5
11
  extension`.
data/README.md CHANGED
@@ -71,6 +71,12 @@ abspath=$(cd ${0%/*} && echo $PWD/${0##*/})
71
71
  $abspath/../../bin/console
72
72
  ```
73
73
 
74
+ ### ORM
75
+
76
+ By default the generated app doesn't come with any ORMs, but if you want to use ActiveRecord, you can use this gem:
77
+ [wd_sinatra_active_record](https://github.com/mattetti/wd_sinatra_active_record)
78
+
79
+
74
80
  ### Documentation generation
75
81
 
76
82
  $ rake doc:services
@@ -213,14 +219,6 @@ Of course, you'll need to require `Yajl` first and add it to your
213
219
  Gemfile if you want to use Bundler.
214
220
 
215
221
 
216
-
217
- ## Using an ORM
218
-
219
- TODO: see https://github.com/mattetti/sinatra-web-api-example/ for now
220
- for an example of setting up ActiveRecord.
221
- Eventually the generator will take an option to generate an AR, DM or
222
- other ORM template.
223
-
224
222
  ## Update
225
223
 
226
224
  To update your app, just update your gem dependency on `wd_sinatra`, you
@@ -29,7 +29,7 @@ module WDSinatra
29
29
  @root = root_path
30
30
  unless @booted
31
31
  set_env
32
- set_loadpath
32
+ set_loadpath(root_path)
33
33
  load_environment
34
34
  load_lib_dependencies
35
35
  load_app_file
@@ -74,8 +74,8 @@ module WDSinatra
74
74
  LOGGER.debug(debug_msg) if debug_msg
75
75
  end
76
76
 
77
- def set_loadpath(root=nil)
78
- root ||= root_path
77
+ def set_loadpath(root)
78
+ @root ||= root
79
79
  $: << root
80
80
  $: << File.join(root, 'lib')
81
81
  $: << File.join(root, 'models')
@@ -1,5 +1,5 @@
1
1
  module WD
2
2
  module Sinatra
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
@@ -17,8 +17,16 @@ task :default => :test
17
17
 
18
18
  # boot the app
19
19
  task :setup_app do
20
- ENV['DONT_CONNECT'] = 'true'
21
- WDSinatra::AppLoader.server(root)
20
+ ENV['DONT_CONNECT'] ||= 'true'
21
+ begin
22
+ WDSinatra::AppLoader.console(root)
23
+ rescue Exception => e
24
+ if defined?(ActiveRecord) && e.is_a?(ActiveRecord::ConnectionNotEstablished)
25
+ ENV['DONT_CONNECT'] == 'true' ? print(e.message+"\n") : raise(e)
26
+ else
27
+ raise(e)
28
+ end
29
+ end
22
30
  end
23
31
 
24
32
  task :environment do
@@ -26,7 +34,7 @@ task :environment do
26
34
  WDSinatra::AppLoader.server(root)
27
35
  end
28
36
 
29
- desc "Prints the available routes set by the application"
37
+ desc "Print the available routes"
30
38
  task :routes do
31
39
  WDSinatra::AppLoader.console(root)
32
40
  print "Available routes: \n"
metadata CHANGED
@@ -1,118 +1,121 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: wd_sinatra
3
- version: !ruby/object:Gem::Version
4
- hash: 17
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 3
10
- version: 1.0.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Matt Aimonetti
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-10-30 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rake
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
31
22
  type: :runtime
32
- requirement: *id001
33
23
  prerelease: false
34
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
35
31
  name: weasel_diesel
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
37
33
  none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 31
42
- segments:
43
- - 1
44
- - 2
45
- - 0
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
46
37
  version: 1.2.0
47
38
  type: :runtime
48
- requirement: *id002
49
39
  prerelease: false
50
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.2.0
46
+ - !ruby/object:Gem::Dependency
51
47
  name: rack
52
- version_requirements: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
53
49
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
61
54
  type: :runtime
62
- requirement: *id003
63
55
  prerelease: false
64
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
65
63
  name: rack-test
66
- version_requirements: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
67
65
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
75
70
  type: :runtime
76
- requirement: *id004
77
71
  prerelease: false
78
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
79
  name: thor
80
- version_requirements: &id005 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
89
86
  type: :runtime
90
- requirement: *id005
91
87
  prerelease: false
92
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
93
95
  name: minitest
94
- version_requirements: &id006 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
95
97
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 3
100
- segments:
101
- - 0
102
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
103
102
  type: :runtime
104
- requirement: *id006
105
103
  prerelease: false
106
- description: Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps using the Weasel Diesel DSL
107
- email:
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ description: Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra
111
+ apps using the Weasel Diesel DSL
112
+ email:
108
113
  - mattaimonetti@gmail.com
109
- executables:
114
+ executables:
110
115
  - wd_sinatra
111
116
  extensions: []
112
-
113
117
  extra_rdoc_files: []
114
-
115
- files:
118
+ files:
116
119
  - .gitignore
117
120
  - .travis.yml
118
121
  - CHANGELOG.md
@@ -209,37 +212,35 @@ files:
209
212
  - wd-sinatra.gemspec
210
213
  homepage: https://github.com/mattetti/wd-sinatra
211
214
  licenses: []
212
-
213
215
  post_install_message:
214
216
  rdoc_options: []
215
-
216
- require_paths:
217
+ require_paths:
217
218
  - lib
218
- required_ruby_version: !ruby/object:Gem::Requirement
219
+ required_ruby_version: !ruby/object:Gem::Requirement
219
220
  none: false
220
- requirements:
221
- - - ">="
222
- - !ruby/object:Gem::Version
223
- hash: 3
224
- segments:
221
+ requirements:
222
+ - - ! '>='
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ segments:
225
226
  - 0
226
- version: "0"
227
- required_rubygems_version: !ruby/object:Gem::Requirement
227
+ hash: 3412356469792400961
228
+ required_rubygems_version: !ruby/object:Gem::Requirement
228
229
  none: false
229
- requirements:
230
- - - ">="
231
- - !ruby/object:Gem::Version
232
- hash: 3
233
- segments:
230
+ requirements:
231
+ - - ! '>='
232
+ - !ruby/object:Gem::Version
233
+ version: '0'
234
+ segments:
234
235
  - 0
235
- version: "0"
236
+ hash: 3412356469792400961
236
237
  requirements: []
237
-
238
238
  rubyforge_project:
239
239
  rubygems_version: 1.8.24
240
240
  signing_key:
241
241
  specification_version: 3
242
- summary: Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps using the Weasel Diesel DSL
243
- test_files:
242
+ summary: Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps
243
+ using the Weasel Diesel DSL
244
+ test_files:
244
245
  - test/test_helper.rb
245
246
  - test/ws_list_ext_test.rb