happy 0.1.0.pre.6 → 0.1.0.pre7
Sign up to get free protection for your applications and to get access to all the features.
- data/happy.gemspec +2 -0
- data/lib/happy/utils/app_spawner.rb +33 -0
- data/lib/happy/version.rb +1 -1
- metadata +31 -19
data/happy.gemspec
CHANGED
@@ -20,6 +20,8 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency 'happy-helpers', '~> 0.1.0.pre.5'
|
21
21
|
gem.add_dependency 'allowance', '>= 0.1.1'
|
22
22
|
|
23
|
+
gem.add_dependency 'happy-cli', '>= 0.1.0.pre1'
|
24
|
+
|
23
25
|
gem.add_development_dependency 'rake'
|
24
26
|
gem.add_development_dependency 'rspec', '~> 2.8'
|
25
27
|
gem.add_development_dependency 'rspec-html-matchers'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Happy
|
2
|
+
module Utils
|
3
|
+
class AppSpawner
|
4
|
+
attr_reader :options
|
5
|
+
|
6
|
+
def initialize(options = {})
|
7
|
+
@options = {
|
8
|
+
:scripts => './app/*.rb'
|
9
|
+
}.merge(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
app.call(env)
|
14
|
+
end
|
15
|
+
|
16
|
+
def app
|
17
|
+
@app = reload_app? ? load_app : @app
|
18
|
+
end
|
19
|
+
|
20
|
+
def load_app
|
21
|
+
Happy::Controller.build.tap do |klass|
|
22
|
+
Dir[options[:scripts]].each do |file|
|
23
|
+
klass.instance_eval File.read(file)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def reload_app?
|
29
|
+
!Happy.env.production?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/happy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre7
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70094629981320 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70094629981320
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rack
|
27
|
-
requirement: &
|
27
|
+
requirement: &70094629980660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.4'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70094629980660
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: happy-helpers
|
38
|
-
requirement: &
|
38
|
+
requirement: &70094629980060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.1.0.pre.5
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70094629980060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: allowance
|
49
|
-
requirement: &
|
49
|
+
requirement: &70094629979400 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,21 @@ dependencies:
|
|
54
54
|
version: 0.1.1
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70094629979400
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: happy-cli
|
60
|
+
requirement: &70094629978660 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.1.0.pre1
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70094629978660
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: rake
|
60
|
-
requirement: &
|
71
|
+
requirement: &70094629978260 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ! '>='
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: '0'
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70094629978260
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: rspec
|
71
|
-
requirement: &
|
82
|
+
requirement: &70094629977480 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ~>
|
@@ -76,10 +87,10 @@ dependencies:
|
|
76
87
|
version: '2.8'
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70094629977480
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: rspec-html-matchers
|
82
|
-
requirement: &
|
93
|
+
requirement: &70094629976940 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,10 +98,10 @@ dependencies:
|
|
87
98
|
version: '0'
|
88
99
|
type: :development
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *70094629976940
|
91
102
|
- !ruby/object:Gem::Dependency
|
92
103
|
name: rack-test
|
93
|
-
requirement: &
|
104
|
+
requirement: &70094629976380 !ruby/object:Gem::Requirement
|
94
105
|
none: false
|
95
106
|
requirements:
|
96
107
|
- - ! '>='
|
@@ -98,10 +109,10 @@ dependencies:
|
|
98
109
|
version: '0'
|
99
110
|
type: :development
|
100
111
|
prerelease: false
|
101
|
-
version_requirements: *
|
112
|
+
version_requirements: *70094629976380
|
102
113
|
- !ruby/object:Gem::Dependency
|
103
114
|
name: watchr
|
104
|
-
requirement: &
|
115
|
+
requirement: &70094630175000 !ruby/object:Gem::Requirement
|
105
116
|
none: false
|
106
117
|
requirements:
|
107
118
|
- - ! '>='
|
@@ -109,7 +120,7 @@ dependencies:
|
|
109
120
|
version: '0'
|
110
121
|
type: :development
|
111
122
|
prerelease: false
|
112
|
-
version_requirements: *
|
123
|
+
version_requirements: *70094630175000
|
113
124
|
description: A happy little toolkit for writing web applications.
|
114
125
|
email:
|
115
126
|
- hendrik@mans.de
|
@@ -138,6 +149,7 @@ files:
|
|
138
149
|
- lib/happy/ext/resources.rb
|
139
150
|
- lib/happy/ext/static.rb
|
140
151
|
- lib/happy/request.rb
|
152
|
+
- lib/happy/utils/app_spawner.rb
|
141
153
|
- lib/happy/version.rb
|
142
154
|
- spec/controller_ext/actions_spec.rb
|
143
155
|
- spec/controller_ext/routing_spec.rb
|