chaplin 0.0.5 → 0.0.6

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: 0f41fef52c31f3690eb520d51590e653a12ecd33
4
- data.tar.gz: 4ac00371936a73d8812dbbe7d388f3c7b6bb9302
3
+ metadata.gz: 7b1dddc8d641246bc416d40ea4b82a6324d0db12
4
+ data.tar.gz: 5b609db70ba47ee8796e071b294d90ebe79dc1a3
5
5
  SHA512:
6
- metadata.gz: f4469afbbfe197c757832979dcf680428031176c8fbc5e3c936efe8a40740d68d983f97c071b01f2ef260458a87123353e9725683d30a64df46e3d26f0e14812
7
- data.tar.gz: 42ea23cd45506bf692f055e4b006655346b4d00cdeb90383cbde6b9cf097be66e6391941332cb2f6674b5bf1830a00a5ecf243e0210e66730fcb8e76edccc2f1
6
+ metadata.gz: 63c5c86b854bd2d3e8f9b2cfd597cca167948542c4bb46df2f503acf73e5e9f3730a0f966a263931adb379f633a035694ddc3d680d226c257b7a0e5a8a084694
7
+ data.tar.gz: 26aa96045ba2aca2b5d0d1aa94c61f264fb0dd16904abf31d6822f85914dc9565e6c42b522d598b127b6b30daa63b2e03a7a5cf74f88f5da98feab74f4aa00ce
data/bin/chaplin CHANGED
@@ -10,6 +10,9 @@ if ARGV[0].nil?
10
10
  elsif ARGV[0] == 'new'
11
11
  new_project_path = ARGV[1]
12
12
  Chaplin::New.(new_project_path)
13
+
14
+ puts "New chaplin project created in #{new_project_path}"
15
+ puts "Start the server with 'chaplin #{new_project_path}'"
13
16
  else
14
17
  project_directory = ARGV[0]
15
18
  chaplin_server = Chaplin.new(project_directory).server
data/lib/chaplin/new.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  class Chaplin
3
2
  module New
4
3
 
@@ -6,10 +5,6 @@ class Chaplin
6
5
  FileUtils.mkdir(new_project_path)
7
6
  FileUtils.cp_r("#{__dir__}/../../sample_project/templates", new_project_path)
8
7
  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
8
  end
14
9
 
15
10
  end
@@ -16,33 +16,13 @@ class Chaplin
16
16
  end
17
17
 
18
18
  def basic_auth
19
- config['basic_auth']
19
+ config['api_basic_auth']
20
20
  end
21
21
 
22
22
  private
23
23
 
24
24
  def config
25
- @config ||= load_yaml || load_json || {}
26
- end
27
-
28
- def load_yaml
29
- if File.exists?(yaml_filename)
30
- YAML.load_file(yaml_filename)
31
- end
32
- end
33
-
34
- def yaml_filename
35
- "#{project_path}/chaplin_config.yml"
36
- end
37
-
38
- def load_json
39
- if File.exists?(json_filename)
40
- JSON.load(File.open(json_filename))
41
- end
42
- end
43
-
44
- def json_filename
45
- "#{project_path}/chaplin_config.json"
25
+ DeclarationFile.app_declaration(project_path)
46
26
  end
47
27
 
48
28
  end
@@ -27,7 +27,7 @@ class Chaplin
27
27
  end
28
28
 
29
29
  def json_filename
30
- project_path + "/routes.json"
30
+ project_path + "/app.json"
31
31
  end
32
32
 
33
33
  def load_yaml
@@ -1,3 +1,5 @@
1
+ api_url: https://api.github.com/
2
+
1
3
  layout: layout.html
2
4
 
3
5
  404: 404.html
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.5
4
+ version: 0.0.6
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-12-05 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -245,7 +245,6 @@ files:
245
245
  - lib/chaplin/responses/redirect.rb
246
246
  - lib/chaplin/server.rb
247
247
  - sample_project/app.yml
248
- - sample_project/chaplin_config.yml
249
248
  - sample_project/templates/404.html
250
249
  - sample_project/templates/about.html
251
250
  - sample_project/templates/index.html
@@ -275,4 +274,3 @@ signing_key:
275
274
  specification_version: 4
276
275
  summary: Build HTML apps from JSON APIs in no time
277
276
  test_files: []
278
- has_rdoc:
@@ -1 +0,0 @@
1
- api_url: https://api.github.com/