ez-core 0.1.1 → 0.2.0

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
- SHA1:
3
- metadata.gz: 6edda3aa5ab6d9d128c6b42c9c564228d250c493
4
- data.tar.gz: db37e3bcbf3453373656eb1230fa61386410b4ab
2
+ SHA256:
3
+ metadata.gz: 86d5274de43b3f7946c94a9a47401b45096cdcd32da91176b6faf434ede711cb
4
+ data.tar.gz: b19a80fd69edb817a01462b4cbcb28d8dc1461fa09dc9d943e68c65a30eb68a9
5
5
  SHA512:
6
- metadata.gz: beeb9a023c8c39dd617280919d32e068af0072aff679aca3dd30e38ee9ea7baf552760bed21a8dfbf1da4e6ab814bde85bd03a43694c3670985bfcd70b885864
7
- data.tar.gz: 3f96622baa61c1569998ba28253b25b86c98bdc6e0523772008c0ac2b19d82f02249dfc56c2f895484002fd723e3b7364e2afdbbb69c815325ea2c6434164df9
6
+ metadata.gz: 28a757d17ddb0b40ed05eabd8b600d25c83160113419f8365db254d219358334678a6bb8c2bcf1d87e8976f55b43939dec315aebffd6eb6e92476ea86becb1a5
7
+ data.tar.gz: 431275b1098ce211815b7475233a1e2a834e12ba5e4ce32e8a24003a1ff4c60d3e3d0f92bfe71e22fae343cfe28c1a0c00597f52473cbf918e4dcda7cff8cf02
@@ -0,0 +1,16 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5
3
+ Exclude:
4
+ - Guardfile
5
+ - config.ru
6
+
7
+ Style/Documentation:
8
+ Enabled: false
9
+
10
+ Metrics/LineLength:
11
+ Max: 120
12
+
13
+ Metrics/BlockLength:
14
+ ExcludedMethods: [
15
+ 'describe', 'context', 'it', 'let', 'before', 'after', 'aggregate_failures'
16
+ ]
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
- # Specify your gem's dependencies in ez-core.gemspec
4
5
  gemspec
data/README.md CHANGED
@@ -20,6 +20,8 @@ Heavily inspired by [dry-rb](http://dry-rb.org/), but for rails.
20
20
 
21
21
  Simple pluggable configuration for using in any module:
22
22
  ```ruby
23
+ require 'ez/configurator'
24
+
23
25
  module MyEngine
24
26
  include Ez::Configurator
25
27
  end
@@ -38,6 +40,8 @@ MyEngine.config.your_value # => 'new value'
38
40
  Registry store for keep all knowledge in one place.
39
41
  Use for store any values across different engines:
40
42
  ```ruby
43
+ require 'ez/registry'
44
+
41
45
  Ez::Registry.in :my_registry, by: MyEngine do |registry|
42
46
  registry.add :first_value
43
47
  registry.add :second_value
@@ -55,6 +59,11 @@ Ez::Registry.store(:my_registry) # =>
55
59
  # ]
56
60
  ```
57
61
 
62
+ All data stores in Recorc#data and you can use `.data` registry method for easy access
63
+ ```ruby
64
+ Ez::Registry.data(:my_registry) # => [ :first_value, :second_value, :third_value ]
65
+ ```
66
+
58
67
  ### Examples:
59
68
  - Dependency inversion
60
69
  - Extend feature list
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "ez/core"
4
+ require 'bundler/setup'
5
+ require 'ez/core'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "ez/core"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'ez/core/version'
5
6
 
@@ -9,22 +10,21 @@ Gem::Specification.new do |s|
9
10
  s.authors = ['Volodya Sveredyuk']
10
11
  s.email = ['sveredyuk@gmail.com']
11
12
 
12
- s.summary = 'Core module for easy Rails apps.'
13
- s.description = 'Core module for easy Rails apps.'
13
+ s.summary = 'Core module for easy Rails apps via EzEngines'
14
+ s.description = 'Core module for easy Rails apps via EzEngines'
14
15
  s.homepage = 'https://github.com/ez-engines'
15
16
  s.license = 'MIT'
16
17
 
17
- s.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
18
19
  f.match(%r{^(test|spec|features)/})
19
20
  end
20
21
 
21
- s.bindir = 'exe'
22
- s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
22
  s.require_paths = ['lib']
24
23
 
25
- s.add_development_dependency 'bundler', '~> 1.15'
26
- s.add_development_dependency 'rake', '~> 10.0'
27
- s.add_development_dependency 'rspec', '~> 3.0'
28
- s.add_development_dependency 'guard-rspec'
24
+ s.add_development_dependency 'bundler', '~> 1.15'
25
+ s.add_development_dependency 'guard-rspec', '~> 4.7'
29
26
  s.add_development_dependency 'pry'
27
+ s.add_development_dependency 'rake', '~> 10.0'
28
+ s.add_development_dependency 'rspec', '~> 3.0'
29
+ s.add_development_dependency 'rubocop'
30
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ostruct'
2
4
 
3
5
  module Ez
@@ -9,8 +11,8 @@ module Ez
9
11
  module Engine
10
12
  class Store < OpenStruct; end
11
13
 
12
- def configure(&block)
13
- block.call(config)
14
+ def configure
15
+ yield(config)
14
16
  end
15
17
 
16
18
  def config
@@ -1,8 +1,6 @@
1
- require 'ez/core/version'
2
- require 'ez/configurator'
3
- require 'ez/registry'
1
+ # frozen_string_literal: true
4
2
 
5
- require 'ez/items/link'
3
+ require 'ez/core/version'
6
4
 
7
5
  module Ez
8
6
  module Core
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ez
2
4
  module Core
3
- VERSION = '0.1.1'
5
+ VERSION = '0.2.0'
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ez
2
4
  module Items
3
5
  class Link
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'singleton'
2
4
 
3
5
  require 'ez/registry/store'
@@ -8,8 +10,7 @@ module Ez
8
10
  include Singleton
9
11
 
10
12
  class << self
11
- def in(key, by:, &block)
12
-
13
+ def in(key, by:)
13
14
  get_or_initialize_store_by(key)
14
15
 
15
16
  add!(yield(Registry::Store.new), to: store[key], by: by)
@@ -35,7 +36,7 @@ module Ez
35
36
  store[key] || store[key] = Registry::Store.new
36
37
  end
37
38
 
38
- def add!(*collection, to: , by:)
39
+ def add!(*collection, to:, by:)
39
40
  collection.flatten.each do |record|
40
41
  record.by = by
41
42
  to.push(record)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ez
2
4
  class Registry
3
5
  class Record
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ez/registry/record'
2
4
 
3
5
  module Ez
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Sveredyuk
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-25 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,49 +25,63 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: guard-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '4.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '4.7'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '3.0'
61
+ version: '10.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '3.0'
68
+ version: '10.0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: guard-rspec
70
+ name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: '3.0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: '3.0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: pry
84
+ name: rubocop
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -80,7 +94,7 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
- description: Core module for easy Rails apps.
97
+ description: Core module for easy Rails apps via EzEngines
84
98
  email:
85
99
  - sveredyuk@gmail.com
86
100
  executables: []
@@ -89,6 +103,7 @@ extra_rdoc_files: []
89
103
  files:
90
104
  - ".gitignore"
91
105
  - ".rspec"
106
+ - ".rubocop.yml"
92
107
  - ".travis.yml"
93
108
  - CODE_OF_CONDUCT.md
94
109
  - Gemfile
@@ -126,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
141
  version: '0'
127
142
  requirements: []
128
143
  rubyforge_project:
129
- rubygems_version: 2.5.1
144
+ rubygems_version: 2.7.7
130
145
  signing_key:
131
146
  specification_version: 4
132
- summary: Core module for easy Rails apps.
147
+ summary: Core module for easy Rails apps via EzEngines
133
148
  test_files: []