anyway_config 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -2
- data/Gemfile +7 -2
- data/gemfiles/jruby.gemfile +7 -0
- data/lib/anyway/config.rb +10 -2
- data/lib/anyway/ext/deep_dup.rb +2 -0
- data/lib/anyway/ext/deep_freeze.rb +13 -0
- data/lib/anyway/ext/hash.rb +2 -0
- data/lib/anyway/version.rb +1 -1
- metadata +4 -4
- data/lib/anyway/ext/class.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 47484989863db8a88b4f66998387c86ca202ecd8e352fce005500ed11ada2aee
|
4
|
+
data.tar.gz: 2353a987747f87c15adf6efe2d888215bdac5d3aa1631b988135f535d6fa6e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba01bdb3ddc7053e72b2e7644af1da4aa94382f8a8d544aa7d76d0f432826356e38d8dae47bd47a46559dd2ca6aa056e47ac21281bc827fe24aca15040ccace6
|
7
|
+
data.tar.gz: 18a500de792a4ab8b3e0255a2f6dfd3b36c2bc415a3590df4d57065ad84e6e2ba23c9877499fd9641317ec80741ed671225a437ea1bf18d07e0a15efca89237f
|
data/.travis.yml
CHANGED
@@ -15,12 +15,16 @@ matrix:
|
|
15
15
|
include:
|
16
16
|
- rvm: ruby-head
|
17
17
|
gemfile: gemfiles/railsmaster.gemfile
|
18
|
-
- rvm:
|
18
|
+
- rvm: jruby-9.1.15.0
|
19
|
+
gemfile: gemfiles/jruby.gemfile
|
20
|
+
- rvm: 2.5.0
|
19
21
|
gemfile: gemfiles/rails5.gemfile
|
20
|
-
- rvm: 2.3
|
22
|
+
- rvm: 2.4.3
|
21
23
|
gemfile: gemfiles/rails42.gemfile
|
22
24
|
- rvm: 2.2.3
|
23
25
|
gemfile: gemfiles/rails42.gemfile
|
24
26
|
allow_failures:
|
25
27
|
- rvm: ruby-head
|
26
28
|
gemfile: gemfiles/railsmaster.gemfile
|
29
|
+
- rvm: jruby-9.1.15.0
|
30
|
+
gemfile: gemfiles/jruby.gemfile
|
data/Gemfile
CHANGED
@@ -3,8 +3,13 @@
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in anyway_config.gemspec
|
6
|
-
gem 'sqlite3'
|
7
|
-
|
6
|
+
gem 'sqlite3', platform: :mri
|
7
|
+
|
8
|
+
gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0', platform: :jruby
|
9
|
+
gem 'jdbc-sqlite3', platform: :jruby
|
10
|
+
|
11
|
+
gem 'pry-byebug', platform: :mri
|
12
|
+
|
8
13
|
gemspec
|
9
14
|
|
10
15
|
local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local"
|
data/lib/anyway/config.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'anyway/ext/class'
|
4
3
|
require 'anyway/ext/deep_dup'
|
5
4
|
require 'anyway/ext/deep_freeze'
|
6
5
|
require 'anyway/ext/hash'
|
7
6
|
|
8
7
|
module Anyway # :nodoc:
|
9
|
-
using Anyway::Ext::Class
|
10
8
|
using Anyway::Ext::DeepDup
|
11
9
|
using Anyway::Ext::DeepFreeze
|
12
10
|
using Anyway::Ext::Hash
|
@@ -46,6 +44,16 @@ module Anyway # :nodoc:
|
|
46
44
|
def for(name)
|
47
45
|
new(name: name, load: false).load_from_sources
|
48
46
|
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def underscore_name
|
51
|
+
return unless name
|
52
|
+
word = name[/^(\w+)/]
|
53
|
+
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
54
|
+
word.downcase!
|
55
|
+
word
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
attr_reader :config_name
|
data/lib/anyway/ext/deep_dup.rb
CHANGED
@@ -21,6 +21,19 @@ module Anyway
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
if defined?(::ActiveSupport::HashWithIndifferentAccess)
|
26
|
+
refine ::ActiveSupport::HashWithIndifferentAccess do
|
27
|
+
def deep_freeze
|
28
|
+
freeze
|
29
|
+
each_value do |value|
|
30
|
+
value.deep_freeze if value.is_a?(::Hash) || value.is_a?(::Array)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
using self
|
24
37
|
end
|
25
38
|
end
|
26
39
|
end
|
data/lib/anyway/ext/hash.rb
CHANGED
data/lib/anyway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anyway_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -72,13 +72,13 @@ files:
|
|
72
72
|
- Rakefile
|
73
73
|
- anyway_config.gemspec
|
74
74
|
- config/cool.yml
|
75
|
+
- gemfiles/jruby.gemfile
|
75
76
|
- gemfiles/rails42.gemfile
|
76
77
|
- gemfiles/rails5.gemfile
|
77
78
|
- gemfiles/railsmaster.gemfile
|
78
79
|
- lib/anyway.rb
|
79
80
|
- lib/anyway/config.rb
|
80
81
|
- lib/anyway/env.rb
|
81
|
-
- lib/anyway/ext/class.rb
|
82
82
|
- lib/anyway/ext/deep_dup.rb
|
83
83
|
- lib/anyway/ext/deep_freeze.rb
|
84
84
|
- lib/anyway/ext/hash.rb
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.7.4
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Configuration DSL for Ruby libraries and applications
|
data/lib/anyway/ext/class.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Anyway
|
4
|
-
module Ext
|
5
|
-
# Extend String through refinements
|
6
|
-
module Class
|
7
|
-
refine ::Class do
|
8
|
-
def underscore_name
|
9
|
-
return unless name
|
10
|
-
word = name[/^(\w+)/]
|
11
|
-
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
12
|
-
word.downcase!
|
13
|
-
word
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|