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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2687d6c62fe47551a7f1d73de05dfbe8350e60a2
4
- data.tar.gz: a94145d9896fa2ac5059f0aa372f3df86d0b1005
3
+ metadata.gz: 669cb29fe96550f45f14eb056d582129fcf2439c
4
+ data.tar.gz: 8859cf62ebd9af843df6525c8cace40ddbafc483
5
5
  SHA512:
6
- metadata.gz: f32d05abe77ab8d0b687e091cfa0f4c0384bc5558ae76d909eaf4f6a6e2eeb0431f5b8c3af4b487537a71ad097ca68cdbfaa9a076e3cc7bd4aebcb00b90514a7
7
- data.tar.gz: c8547744187747d7c505f8cb3f9ac294d52edd305ae428428683fff964b13e35adc8665865c7028feb7035fe0de56a9923bfee9b8a5f21cce50e5ad50589575c
6
+ metadata.gz: '08935e3269b27767a3e86ae34e1ddeccb0c40a2111d1b51f3ef1ca59f8107b80decddfabc9ca5dbe7bbab79d3bc1e9dab06e84247aa7798250dd187a2fdf99aa'
7
+ data.tar.gz: 9b1b3264bfe6e8c4b208e55f9819faa040d091fb1a97c7b220b3b333e70e079e7567a7f5d1d514123e98eeea2c94512d61e964de4f60882941e961ab9cf862c2
data/.gitignore CHANGED
@@ -33,3 +33,5 @@ Gemfile.lock
33
33
 
34
34
  .byebug_history
35
35
  /vendor/cache/
36
+
37
+ .idea
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 "inflecto"
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: Inflecto.underscore(target_dir),
24
- camel_cased_app_name: Inflecto.camelize(target_dir)
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: Inflecto.underscore(target_dir),
27
- camel_cased_app_name: Inflecto.camelize(target_dir),
28
- underscored_umbrella_name: Inflecto.underscore(umbrella_name),
29
- camel_cased_umbrella_name: Inflecto.camelize(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: Inflecto.underscore(target_dir),
31
- camel_cased_app_name: Inflecto.camelize(target_dir)
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
@@ -4,6 +4,8 @@
4
4
  require "sequel"
5
5
  require "rom"
6
6
 
7
+ use :monitor
8
+
7
9
  Sequel.database_timezone = :utc
8
10
  Sequel.application_timezone = :local
9
11
 
@@ -3,6 +3,8 @@
3
3
  init do
4
4
  require "sequel"
5
5
  require "rom"
6
+
7
+ use :monitor
6
8
 
7
9
  Sequel.database_timezone = :utc
8
10
  Sequel.application_timezone = :local
@@ -1,7 +1,7 @@
1
1
  module Dry
2
2
  module Web
3
3
  module Roda
4
- VERSION = "0.6.1".freeze
4
+ VERSION = "0.6.2".freeze
5
5
  end
6
6
  end
7
7
  end
@@ -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.1
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-08 00:00:00.000000000 Z
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