hefted 0.3.0 → 0.4.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
2
  SHA1:
3
- metadata.gz: 5a8b29e7dba7be574961c7808e210282116f3bda
4
- data.tar.gz: 2ccc73b9ab5110132910841053166b8cf3ef3d65
3
+ metadata.gz: 81b89197076a6efce3a1fcdaeae0c042fc554936
4
+ data.tar.gz: f9f0ba57989d12c729afe656585fb8ca381134a8
5
5
  SHA512:
6
- metadata.gz: 38f865a2c7818644170f06400d850c4e29de74c86f8ba40b616b62a62f293d2499fa32b229371523fc66a65f071a1d153ce160d6e9e6038cf322cac854f3b7e4
7
- data.tar.gz: 0f277061fca3371951e5f7398bc48af287a569e81ea6a5b7aa1cf47c31a02f0a94738a3679adc6c15b02f40e40225a87e6436523fb7039a7cf0400dc411a13ea
6
+ metadata.gz: e3ddbc1744b6437091762e7f1dbbd4942aa6572ac13f609bfd7ae712b94f4b47c175a6ba00b4e9dba627d8db5b6c143d94eb9ab80e1020c2ed881846968488f6
7
+ data.tar.gz: 5352eac067c5ec8c666f02bcf54cab0bf0d75d39ee920e83bd605330a79673ee0481432b829f4677cef61447c6abda654eacdf513570ddb5c0b5c9cf1cfde0df
@@ -1,5 +1,3 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
1
  AllCops:
4
2
  TargetRubyVersion: 2.3
5
3
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'hefted/version'
4
+ require "hefted/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "hefted"
@@ -6,7 +6,9 @@ module Hefted
6
6
  arguments = const_join(args)
7
7
  template = Base.new(*arguments.keys)
8
8
  self.const_set(arguments.name, template.new(*arguments.values).freeze)
9
+ @hefts = (@hefts.nil? ? [] : @hefts) << arguments.name
9
10
  end
11
+ attr_reader :hefts
10
12
 
11
13
  def release_hefted(*names)
12
14
  names.each do |name|
@@ -14,19 +16,6 @@ module Hefted
14
16
  end
15
17
  end
16
18
 
17
- private
18
- def const_join(**args)
19
- arguments = Argument.new(**args)
20
- if arguments.join?
21
- _consts = arguments.joins.each_with_object({}) do |name, hash|
22
- hash.merge!(self.const_get(name).to_h)
23
- end.merge!(arguments.keys.zip(arguments.values).to_h)
24
- Argument.new(name: arguments.name, **_consts)
25
- else
26
- arguments
27
- end
28
- end
29
-
30
19
  class Base < Struct
31
20
  def each
32
21
  return to_enum(:each) unless block_given?
@@ -84,5 +73,18 @@ module Hefted
84
73
  end
85
74
  end
86
75
  private_constant :Base
76
+
77
+ private
78
+ def const_join(**args)
79
+ arguments = Argument.new(**args)
80
+ if arguments.join?
81
+ _consts = arguments.joins.each_with_object({}) do |name, hash|
82
+ hash.merge!(self.const_get(name).to_h)
83
+ end.merge!(arguments.keys.zip(arguments.values).to_h)
84
+ Argument.new(name: arguments.name, **_consts)
85
+ else
86
+ arguments
87
+ end
88
+ end
87
89
  end
88
90
  end
@@ -1,3 +1,3 @@
1
1
  module Hefted
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hefted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - weathare
@@ -76,7 +76,6 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - ".rubocop.yml"
79
- - ".rubocop_todo.yml"
80
79
  - ".travis.yml"
81
80
  - Gemfile
82
81
  - README.md
@@ -1,41 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2017-03-09 13:15:36 +0900 using RuboCop version 0.47.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- Style/Documentation:
11
- Exclude:
12
- - 'spec/**/*'
13
- - 'test/**/*'
14
- - 'lib/hefted.rb'
15
-
16
- # Offense count: 1
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
19
- # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
20
- Style/HashSyntax:
21
- EnforcedStyle: hash_rockets
22
-
23
- # Offense count: 1
24
- # Cop supports --auto-correct.
25
- Style/MutableConstant:
26
- Exclude:
27
- - 'lib/hefted/version.rb'
28
-
29
- # Offense count: 26
30
- # Cop supports --auto-correct.
31
- # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
32
- # SupportedStyles: single_quotes, double_quotes
33
- Style/StringLiterals:
34
- Exclude:
35
- - 'Rakefile'
36
- - 'bin/console'
37
- - 'hefted.gemspec'
38
- - 'lib/hefted.rb'
39
- - 'lib/hefted/version.rb'
40
- - 'spec/hefted_spec.rb'
41
- - 'spec/spec_helper.rb'