transproc 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +15 -0
  3. data/.gitignore +3 -0
  4. data/.travis.yml +14 -10
  5. data/CHANGELOG.md +61 -17
  6. data/Gemfile +9 -18
  7. data/README.md +17 -19
  8. data/Rakefile +1 -0
  9. data/lib/transproc.rb +3 -4
  10. data/lib/transproc/all.rb +2 -0
  11. data/lib/transproc/array.rb +9 -51
  12. data/lib/transproc/array/combine.rb +61 -0
  13. data/lib/transproc/class.rb +2 -0
  14. data/lib/transproc/coercions.rb +2 -0
  15. data/lib/transproc/compiler.rb +45 -0
  16. data/lib/transproc/composer.rb +2 -0
  17. data/lib/transproc/composite.rb +2 -0
  18. data/lib/transproc/conditional.rb +2 -0
  19. data/lib/transproc/constants.rb +5 -0
  20. data/lib/transproc/error.rb +2 -0
  21. data/lib/transproc/function.rb +4 -1
  22. data/lib/transproc/functions.rb +2 -0
  23. data/lib/transproc/hash.rb +105 -45
  24. data/lib/transproc/proc.rb +2 -0
  25. data/lib/transproc/recursion.rb +2 -0
  26. data/lib/transproc/registry.rb +4 -2
  27. data/lib/transproc/store.rb +1 -0
  28. data/lib/transproc/support/deprecations.rb +2 -0
  29. data/lib/transproc/transformer.rb +7 -1
  30. data/lib/transproc/transformer/class_interface.rb +32 -65
  31. data/lib/transproc/transformer/deprecated/class_interface.rb +81 -0
  32. data/lib/transproc/transformer/dsl.rb +51 -0
  33. data/lib/transproc/version.rb +3 -1
  34. data/spec/spec_helper.rb +21 -10
  35. data/spec/unit/array/combine_spec.rb +224 -0
  36. data/spec/unit/array_transformations_spec.rb +1 -52
  37. data/spec/unit/class_transformations_spec.rb +10 -7
  38. data/spec/unit/coercions_spec.rb +1 -1
  39. data/spec/unit/composer_spec.rb +1 -1
  40. data/spec/unit/conditional_spec.rb +1 -1
  41. data/spec/unit/function_not_found_error_spec.rb +1 -1
  42. data/spec/unit/function_spec.rb +16 -1
  43. data/spec/unit/hash_transformations_spec.rb +12 -1
  44. data/spec/unit/proc_transformations_spec.rb +3 -1
  45. data/spec/unit/recursion_spec.rb +1 -1
  46. data/spec/unit/registry_spec.rb +9 -1
  47. data/spec/unit/store_spec.rb +2 -1
  48. data/spec/unit/transformer/class_interface_spec.rb +364 -0
  49. data/spec/unit/transformer/dsl_spec.rb +15 -0
  50. data/spec/unit/transformer/instance_methods_spec.rb +25 -0
  51. data/spec/unit/transformer_spec.rb +128 -40
  52. data/spec/unit/transproc_spec.rb +1 -1
  53. data/transproc.gemspec +1 -5
  54. metadata +19 -54
  55. data/.rubocop.yml +0 -66
  56. data/.rubocop_todo.yml +0 -11
  57. data/rakelib/mutant.rake +0 -16
  58. data/rakelib/rubocop.rake +0 -18
  59. 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
@@ -1,10 +0,0 @@
1
- module Mutant
2
- class Selector
3
- # Expression based test selector
4
- class Expression < self
5
- def call(_subject)
6
- integration.all_tests
7
- end
8
- end # Expression
9
- end # Selector
10
- end # Mutant