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 +4 -4
- data/.rubocop.yml +0 -2
- data/hefted.gemspec +2 -2
- data/lib/hefted/class_method.rb +15 -13
- data/lib/hefted/version.rb +1 -1
- metadata +1 -2
- data/.rubocop_todo.yml +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81b89197076a6efce3a1fcdaeae0c042fc554936
|
4
|
+
data.tar.gz: f9f0ba57989d12c729afe656585fb8ca381134a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3ddbc1744b6437091762e7f1dbbd4942aa6572ac13f609bfd7ae712b94f4b47c175a6ba00b4e9dba627d8db5b6c143d94eb9ab80e1020c2ed881846968488f6
|
7
|
+
data.tar.gz: 5352eac067c5ec8c666f02bcf54cab0bf0d75d39ee920e83bd605330a79673ee0481432b829f4677cef61447c6abda654eacdf513570ddb5c0b5c9cf1cfde0df
|
data/.rubocop.yml
CHANGED
data/hefted.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "hefted/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "hefted"
|
data/lib/hefted/class_method.rb
CHANGED
@@ -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
|
data/lib/hefted/version.rb
CHANGED
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.
|
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
|
data/.rubocop_todo.yml
DELETED
@@ -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'
|