roda-project 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 481798dedf638baf4a37f1a8f1c554086eaa1fe9ba9ad409b6301a6693d5ab32
4
- data.tar.gz: fa9bb1b2f1f6d7d465ebda947b1e62a3d5c4a0cb9e3837db4abd59c2df3304b5
3
+ metadata.gz: aeff4fdaddf4c0b61eb4fe2f5f2f89b025897eda318d92ecf1a786ee9ff110d1
4
+ data.tar.gz: 50891c013749f5b94378d1259834d5b6c8dafb7bc92ec3092aef74b5ac24080f
5
5
  SHA512:
6
- metadata.gz: 63e2755468f18b312a2de6f09117564ea91d073bcb55422f1963737ed04268087cdb7555ae2fd60e6742f7e64ac465decfde11dac17886dd52c81a42baa5a979
7
- data.tar.gz: e2755bb05abdd00d0fc285b2975aa07ace46b8d885a53af09f3b08be1bcd636e56877c44f7dd8daf99ce4dd2b0c3954405bf9de3f4728d1b02c03d3ae2ae0532
6
+ metadata.gz: 9bc4575aeb9625e2728ef01c6b5ce699c3b8d1c86a55936e75c5bf2a76105a6b91eaafbd2bca11c47118bd57ae30145b83e7ffda4e17099d09d1ea993f802211
7
+ data.tar.gz: b57e42ba6d7e0c9867801bf52ddb25b341914b0d575761f23a6190ff12b36660ad9db8afb78535847b83ee06496ff78cce8ed422b0f4879e96e52c95371a8dab
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Roda
4
4
  module Project
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -137,7 +137,7 @@ namespace :g do<% if context.database? %>
137
137
  exit 1
138
138
  end
139
139
 
140
- must_generate_views = Dir.exist?(File.expand_path("../../app/views", __dir__))
140
+ must_generate_views = Dir.exist?(File.expand_path("./app/views", __dir__))
141
141
  ensure_and_get_path = proc do |path|
142
142
  base_path = File.expand_path(path, __dir__)
143
143
  full_path_dir = File.join(base_path, File.dirname(branch_name))
@@ -145,14 +145,14 @@ namespace :g do<% if context.database? %>
145
145
 
146
146
  base_path
147
147
  end
148
- parse_route_string = proc do
148
+ parse_route_string = proc do |route_str|
149
149
  name, method = route_str.split(":", 2)
150
150
  method ||= "get"
151
151
  [method, name]
152
152
  end
153
153
 
154
154
  # Generate routes
155
- filename = File.join(ensure_and_get_path.call("../../app/routes"), "#{branch_name}.rb")
155
+ filename = File.join(ensure_and_get_path.call("./app/routes"), "#{branch_name}.rb")
156
156
  route_definitions = routes_list.map do |route_str|
157
157
  method, name = parse_route_string.call(route_str)
158
158
  view_line = (method == "get" && must_generate_views) ? "\n view('#{name}')" : ""
@@ -171,7 +171,7 @@ namespace :g do<% if context.database? %>
171
171
 
172
172
  # Generate views
173
173
  if must_generate_views
174
- branch_views_dir = File.join(File.expand_path("../../app/views", __dir__), branch_name)
174
+ branch_views_dir = File.join(File.expand_path("./app/views", __dir__), branch_name)
175
175
  FileUtils.mkdir_p(branch_views_dir)
176
176
  routes_list.each do |route_str|
177
177
  method, name = parse_route_string.call(route_str)
@@ -184,7 +184,7 @@ namespace :g do<% if context.database? %>
184
184
  end
185
185
 
186
186
  # Generate tests
187
- test_filename = File.join(ensure_and_get_path.call("../../spec/app/routes"), "#{branch_name}_spec.rb")
187
+ test_filename = File.join(ensure_and_get_path.call("./spec/app/routes"), "#{branch_name}_spec.rb")
188
188
  nesting_level = branch_name.count("/")
189
189
  relative_spec_helper_path = "../" * (2 + nesting_level) + "spec_helper"
190
190
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique F. Teixeira