transproc 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +15 -0
- data/.gitignore +3 -0
- data/.travis.yml +10 -10
- data/CHANGELOG.md +14 -2
- data/Gemfile +5 -17
- data/lib/transproc.rb +3 -4
- data/lib/transproc/all.rb +2 -0
- data/lib/transproc/array.rb +2 -0
- data/lib/transproc/array/combine.rb +2 -0
- data/lib/transproc/class.rb +2 -0
- data/lib/transproc/coercions.rb +2 -0
- data/lib/transproc/compiler.rb +45 -0
- data/lib/transproc/composer.rb +2 -0
- data/lib/transproc/composite.rb +2 -0
- data/lib/transproc/conditional.rb +2 -0
- data/lib/transproc/constants.rb +5 -0
- data/lib/transproc/error.rb +2 -0
- data/lib/transproc/function.rb +2 -0
- data/lib/transproc/functions.rb +2 -0
- data/lib/transproc/hash.rb +31 -0
- data/lib/transproc/proc.rb +2 -0
- data/lib/transproc/recursion.rb +2 -0
- data/lib/transproc/registry.rb +1 -0
- data/lib/transproc/store.rb +1 -0
- data/lib/transproc/support/deprecations.rb +2 -0
- data/lib/transproc/transformer.rb +7 -1
- data/lib/transproc/transformer/class_interface.rb +31 -65
- data/lib/transproc/transformer/deprecated/class_interface.rb +80 -0
- data/lib/transproc/transformer/dsl.rb +51 -0
- data/lib/transproc/version.rb +3 -1
- data/spec/spec_helper.rb +5 -7
- data/spec/unit/array/combine_spec.rb +3 -1
- data/spec/unit/array_transformations_spec.rb +1 -1
- data/spec/unit/class_transformations_spec.rb +9 -6
- data/spec/unit/coercions_spec.rb +1 -1
- data/spec/unit/composer_spec.rb +1 -1
- data/spec/unit/conditional_spec.rb +1 -1
- data/spec/unit/function_not_found_error_spec.rb +1 -1
- data/spec/unit/function_spec.rb +1 -1
- data/spec/unit/hash_transformations_spec.rb +12 -1
- data/spec/unit/proc_transformations_spec.rb +3 -1
- data/spec/unit/recursion_spec.rb +1 -1
- data/spec/unit/registry_spec.rb +1 -1
- data/spec/unit/store_spec.rb +2 -1
- data/spec/unit/transformer/class_interface_spec.rb +364 -0
- data/spec/unit/transformer/dsl_spec.rb +15 -0
- data/spec/unit/transformer/instance_methods_spec.rb +25 -0
- data/spec/unit/transformer_spec.rb +128 -40
- data/spec/unit/transproc_spec.rb +1 -1
- data/transproc.gemspec +0 -4
- metadata +15 -53
- data/.rubocop.yml +0 -66
- data/.rubocop_todo.yml +0 -11
- data/rakelib/mutant.rake +0 -16
- data/rakelib/rubocop.rake +0 -18
- data/spec/support/mutant.rb +0 -10
data/.rubocop.yml
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
|
-
# Exclude temporary files
|
4
|
-
AllCops:
|
5
|
-
Exclude:
|
6
|
-
- tmp/**/*
|
7
|
-
|
8
|
-
# Allow global Transproc method definition
|
9
|
-
Style/MethodName:
|
10
|
-
Exclude:
|
11
|
-
- lib/transproc.rb
|
12
|
-
|
13
|
-
# No need to handle LoadError in Rakefile
|
14
|
-
Lint/HandleExceptions:
|
15
|
-
Exclude:
|
16
|
-
- rakelib/*.rake
|
17
|
-
- spec/spec_helper.rb
|
18
|
-
|
19
|
-
# It’s quite readable when we know what we are doing
|
20
|
-
Lint/AssignmentInCondition:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
# The enforced style doesn’t match Vim’s defaults
|
24
|
-
Style/AlignParameters:
|
25
|
-
Enabled: false
|
26
|
-
|
27
|
-
# UTF-8 is perfectly fine in comments
|
28
|
-
Style/AsciiComments:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
# Allow using braces for value-returning blocks
|
32
|
-
Style/BlockDelimiters:
|
33
|
-
Enabled: false
|
34
|
-
|
35
|
-
# Documentation checked by Inch CI
|
36
|
-
Style/Documentation:
|
37
|
-
Enabled: false
|
38
|
-
|
39
|
-
# Early returns have their vices
|
40
|
-
Style/GuardClause:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
# Need to be skipped for >-> usage
|
44
|
-
Style/Lambda:
|
45
|
-
Enabled: false
|
46
|
-
|
47
|
-
# Multiline block chains are ok
|
48
|
-
Style/MultilineBlockChain:
|
49
|
-
Enabled: false
|
50
|
-
|
51
|
-
# Even a single escaped slash can be confusing
|
52
|
-
Style/RegexpLiteral:
|
53
|
-
EnforcedStyle: percent_r
|
54
|
-
|
55
|
-
# Don’t introduce semantic fail/raise distinction
|
56
|
-
Style/SignalException:
|
57
|
-
EnforcedStyle: only_raise
|
58
|
-
|
59
|
-
# Allow compact style for specs
|
60
|
-
Style/ClassAndModuleChildren:
|
61
|
-
Exclude:
|
62
|
-
- spec/**/*_spec.rb
|
63
|
-
|
64
|
-
# Allow logical `or`/`and` in conditionals
|
65
|
-
Style/AndOr:
|
66
|
-
EnforcedStyle: conditionals
|
data/.rubocop_todo.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2015-04-16 18:31:27 +0100 using RuboCop version 0.26.0.
|
3
|
-
# The point is for the user to remove these configuration records
|
4
|
-
# one by one as the offenses are removed from the code base.
|
5
|
-
# Note that changes in the inspected code, or installation of new
|
6
|
-
# versions of RuboCop, may require this file to be generated again.
|
7
|
-
|
8
|
-
# Offense count: 11
|
9
|
-
# Configuration parameters: AllowURI.
|
10
|
-
Metrics/LineLength:
|
11
|
-
Max: 110
|
data/rakelib/mutant.rake
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
desc 'Run mutant against a specific subject'
|
2
|
-
task :mutant do
|
3
|
-
subject = ARGV.last
|
4
|
-
if subject == 'mutant'
|
5
|
-
abort "usage: rake mutant SUBJECT\nexample: rake mutant Transproc::Recursion"
|
6
|
-
else
|
7
|
-
opts = {
|
8
|
-
'include' => 'lib',
|
9
|
-
'require' => 'transproc/all',
|
10
|
-
'use' => 'rspec',
|
11
|
-
'ignore-subject' => "#{subject}#respond_to_missing?"
|
12
|
-
}.to_a.map { |k, v| "--#{k} #{v}" }.join(' ')
|
13
|
-
|
14
|
-
exec("bundle exec mutant #{opts} #{subject}")
|
15
|
-
end
|
16
|
-
end
|
data/rakelib/rubocop.rake
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rubocop/rake_task'
|
3
|
-
|
4
|
-
Rake::Task[:default].enhance [:rubocop]
|
5
|
-
|
6
|
-
RuboCop::RakeTask.new do |task|
|
7
|
-
task.options << '--display-cop-names'
|
8
|
-
end
|
9
|
-
|
10
|
-
namespace :rubocop do
|
11
|
-
desc 'Generate a configuration file acting as a TODO list.'
|
12
|
-
task :auto_gen_config do
|
13
|
-
exec 'bundle exec rubocop --auto-gen-config'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
rescue LoadError
|
18
|
-
end
|