chaplin 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/chaplin +1 -6
- data/lib/chaplin/new.rb +16 -0
- data/lib/chaplin/server.rb +2 -2
- data/lib/chaplin.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac0c5ecdd0aef077f2507a0598322f41a767704d
|
4
|
+
data.tar.gz: d8b881871b606dde3c33b156ee3d6e82d4c8d9a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23819dd64b1543a3496b75699d9b078320d5ef6fc1f69a717747fc4e60c740f10b5853678a4fa426b1fe3f640c02a2a5d10ba74629a38b57bf884384e13f39df
|
7
|
+
data.tar.gz: 376704c6af4096f98d85f1bfe5c5565ee57cf7e679a3c247b0f29bdb723aa9d232625dd340e85b93c337b3afc74321dd4734afd03c3ac2318479aa46d8602352
|
data/bin/chaplin
CHANGED
@@ -9,12 +9,7 @@ if ARGV[0].nil?
|
|
9
9
|
puts "$ chaplin new my_chaplin_project_directory_name"
|
10
10
|
elsif ARGV[0] == 'new'
|
11
11
|
new_project_path = ARGV[1]
|
12
|
-
|
13
|
-
FileUtils.mkdir(new_project_path)
|
14
|
-
FileUtils.cp_r("#{__dir__}/../sample_project/.", new_project_path)
|
15
|
-
|
16
|
-
puts "New chaplin project created in #{new_project_path}"
|
17
|
-
puts "Start the server with '$ chaplin #{new_project_path}'"
|
12
|
+
Chaplin::New.(new_project_path)
|
18
13
|
else
|
19
14
|
project_directory = ARGV[0]
|
20
15
|
chaplin_server = Chaplin.new(project_directory).server
|
data/lib/chaplin/new.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
class Chaplin
|
3
|
+
module New
|
4
|
+
|
5
|
+
def self.call(new_project_path)
|
6
|
+
FileUtils.mkdir(new_project_path)
|
7
|
+
FileUtils.cp_r("#{__dir__}/../../sample_project/templates", new_project_path)
|
8
|
+
FileUtils.cp("#{__dir__}/../../sample_project/app.yml", new_project_path)
|
9
|
+
FileUtils.cp("#{__dir__}/../../sample_project/chaplin_config.yml", new_project_path)
|
10
|
+
|
11
|
+
puts "New chaplin project created in #{new_project_path}"
|
12
|
+
puts "Start the server with 'chaplin #{new_project_path}'"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/lib/chaplin/server.rb
CHANGED
@@ -18,8 +18,8 @@ class Chaplin
|
|
18
18
|
|
19
19
|
def self.add_route(endpoint, response)
|
20
20
|
send(endpoint.http_method, endpoint.path) do
|
21
|
-
|
22
|
-
response.execute(
|
21
|
+
params_with_cookies_and_session = (params || {}).merge(cookies: cookies, session: session)
|
22
|
+
response.execute(params_with_cookies_and_session, self)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/chaplin.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chaplin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Mours
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- lib/chaplin/api_endpoint.rb
|
234
234
|
- lib/chaplin/endpoint.rb
|
235
235
|
- lib/chaplin/inline_partial.rb
|
236
|
+
- lib/chaplin/new.rb
|
236
237
|
- lib/chaplin/parser.rb
|
237
238
|
- lib/chaplin/parser/api_endpoints.rb
|
238
239
|
- lib/chaplin/parser/config.rb
|
@@ -268,3 +269,4 @@ signing_key:
|
|
268
269
|
specification_version: 4
|
269
270
|
summary: Build HTML apps from JSON APIs in no time
|
270
271
|
test_files: []
|
272
|
+
has_rdoc:
|