dry-web-roda 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +7 -0
- data/lib/dry/web/roda/generators/flat_project.rb +4 -3
- data/lib/dry/web/roda/generators/inflections.rb +21 -0
- data/lib/dry/web/roda/generators/sub_app.rb +5 -5
- data/lib/dry/web/roda/generators/umbrella_project.rb +3 -3
- data/lib/dry/web/roda/skeletons/flat_project/system/boot/rom.rb.tt +2 -0
- data/lib/dry/web/roda/skeletons/umbrella_project/system/boot/rom.rb.tt +2 -0
- data/lib/dry/web/roda/version.rb +1 -1
- data/spec/unit/generators/inflections_spec.rb +33 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 669cb29fe96550f45f14eb056d582129fcf2439c
|
4
|
+
data.tar.gz: 8859cf62ebd9af843df6525c8cace40ddbafc483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08935e3269b27767a3e86ae34e1ddeccb0c40a2111d1b51f3ef1ca59f8107b80decddfabc9ca5dbe7bbab79d3bc1e9dab06e84247aa7798250dd187a2fdf99aa'
|
7
|
+
data.tar.gz: 9b1b3264bfe6e8c4b208e55f9819faa040d091fb1a97c7b220b3b333e70e079e7567a7f5d1d514123e98eeea2c94512d61e964de4f60882941e961ab9cf862c2
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 0.6.2 - 2017-02-20
|
2
|
+
|
3
|
+
### Fixed
|
4
|
+
|
5
|
+
- Support dashed names when generating projects, e.g. `dry-web-roda new my-app` (radar & timriley)
|
6
|
+
- Require securerandom for generating session keys in new flat architecture projects (alexandru-calinoiu)
|
7
|
+
|
1
8
|
# 0.6.1 - 2017-02-08
|
2
9
|
|
3
10
|
### Added
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require "
|
1
|
+
require "securerandom"
|
2
2
|
require "dry/web/roda/generate"
|
3
|
+
require "dry/web/roda/generators/inflections"
|
3
4
|
|
4
5
|
module Dry
|
5
6
|
module Web
|
@@ -20,8 +21,8 @@ module Dry
|
|
20
21
|
|
21
22
|
def prepare_scope(target_dir)
|
22
23
|
{
|
23
|
-
underscored_app_name:
|
24
|
-
camel_cased_app_name:
|
24
|
+
underscored_app_name: Inflections.underscored_name(target_dir),
|
25
|
+
camel_cased_app_name: Inflections.camel_cased_name(target_dir)
|
25
26
|
}
|
26
27
|
end
|
27
28
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "inflecto"
|
2
|
+
|
3
|
+
module Dry
|
4
|
+
module Web
|
5
|
+
module Roda
|
6
|
+
module Generators
|
7
|
+
module Inflections
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def underscored_name(name)
|
11
|
+
Inflecto.underscore(name)
|
12
|
+
end
|
13
|
+
|
14
|
+
def camel_cased_name(name)
|
15
|
+
Inflecto.camelize(underscored_name(name))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require "inflecto"
|
2
1
|
require "dry/web/roda/generate"
|
2
|
+
require "dry/web/roda/generators/inflections"
|
3
3
|
|
4
4
|
module Dry
|
5
5
|
module Web
|
@@ -23,10 +23,10 @@ module Dry
|
|
23
23
|
|
24
24
|
def prepare_scope(target_dir, umbrella_name)
|
25
25
|
{
|
26
|
-
underscored_app_name:
|
27
|
-
camel_cased_app_name:
|
28
|
-
underscored_umbrella_name:
|
29
|
-
camel_cased_umbrella_name:
|
26
|
+
underscored_app_name: Inflections.underscored_name(target_dir),
|
27
|
+
camel_cased_app_name: Inflections.camel_cased_name(target_dir),
|
28
|
+
underscored_umbrella_name: Inflections.underscored_name(umbrella_name),
|
29
|
+
camel_cased_umbrella_name: Inflections.camel_cased_name(umbrella_name),
|
30
30
|
}
|
31
31
|
end
|
32
32
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require "inflecto"
|
2
1
|
require "securerandom"
|
3
2
|
require "dry/web/roda/generate"
|
3
|
+
require "dry/web/roda/generators/inflections"
|
4
4
|
require "dry/web/roda/generators/sub_app"
|
5
5
|
|
6
6
|
module Dry
|
@@ -27,8 +27,8 @@ module Dry
|
|
27
27
|
|
28
28
|
def prepare_scope(target_dir)
|
29
29
|
{
|
30
|
-
underscored_app_name:
|
31
|
-
camel_cased_app_name:
|
30
|
+
underscored_app_name: Inflections.underscored_name(target_dir),
|
31
|
+
camel_cased_app_name: Inflections.camel_cased_name(target_dir)
|
32
32
|
}
|
33
33
|
end
|
34
34
|
end
|
data/lib/dry/web/roda/version.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require "dry/web/roda/generators/inflections"
|
2
|
+
|
3
|
+
RSpec.describe Dry::Web::Roda::Generators::Inflections do
|
4
|
+
subject(:inflections) { described_class }
|
5
|
+
|
6
|
+
describe ".underscored_name" do
|
7
|
+
it "leaves an already underscored name" do
|
8
|
+
expect(inflections.underscored_name("my_app")).to eq "my_app"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "leaves a name without any sort of delimiters" do
|
12
|
+
expect(inflections.underscored_name("myapp")).to eq "myapp"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "converts a dashed name" do
|
16
|
+
expect(inflections.underscored_name("my-app")).to eq "my_app"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe ".camel_cased_name" do
|
21
|
+
it "leaves an already camel cased name" do
|
22
|
+
expect(inflections.camel_cased_name("MyApp")).to eq "MyApp"
|
23
|
+
end
|
24
|
+
|
25
|
+
it "converts a dashed name" do
|
26
|
+
expect(inflections.camel_cased_name("my-app")).to eq "MyApp"
|
27
|
+
end
|
28
|
+
|
29
|
+
it "converts an underscored name" do
|
30
|
+
expect(inflections.camel_cased_name("my_app")).to eq "MyApp"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-web-roda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-web
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/dry/web/roda/cli/generate.rb
|
223
223
|
- lib/dry/web/roda/generate.rb
|
224
224
|
- lib/dry/web/roda/generators/flat_project.rb
|
225
|
+
- lib/dry/web/roda/generators/inflections.rb
|
225
226
|
- lib/dry/web/roda/generators/sub_app.rb
|
226
227
|
- lib/dry/web/roda/generators/umbrella_project.rb
|
227
228
|
- lib/dry/web/roda/skeletons/flat_project/Gemfile
|
@@ -321,6 +322,7 @@ files:
|
|
321
322
|
- spec/support/project.rb
|
322
323
|
- spec/support/requests.rb
|
323
324
|
- spec/support/silently.rb
|
325
|
+
- spec/unit/generators/inflections_spec.rb
|
324
326
|
homepage: https://github.com/dry-rb/dry-web-roda
|
325
327
|
licenses:
|
326
328
|
- MIT
|
@@ -357,3 +359,4 @@ test_files:
|
|
357
359
|
- spec/support/project.rb
|
358
360
|
- spec/support/requests.rb
|
359
361
|
- spec/support/silently.rb
|
362
|
+
- spec/unit/generators/inflections_spec.rb
|