synvert 0.0.17 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +4 -0
- data/README.md +7 -26
- data/bin/synvert +0 -1
- data/lib/synvert/cli.rb +26 -14
- data/lib/synvert/snippet.rb +17 -0
- data/lib/synvert/version.rb +1 -1
- data/lib/synvert.rb +3 -11
- data/synvert.gemspec +2 -3
- metadata +6 -85
- data/lib/synvert/configuration.rb +0 -25
- data/lib/synvert/exceptions.rb +0 -13
- data/lib/synvert/node_ext.rb +0 -319
- data/lib/synvert/rewriter/action.rb +0 -224
- data/lib/synvert/rewriter/condition.rb +0 -56
- data/lib/synvert/rewriter/gem_spec.rb +0 -42
- data/lib/synvert/rewriter/instance.rb +0 -185
- data/lib/synvert/rewriter/scope.rb +0 -46
- data/lib/synvert/rewriter.rb +0 -200
- data/lib/synvert/snippets/check_syntax.rb +0 -5
- data/lib/synvert/snippets/factory_girl/syntax_methods.rb +0 -98
- data/lib/synvert/snippets/rails/convert_dynamic_finders.rb +0 -93
- data/lib/synvert/snippets/rails/strong_parameters.rb +0 -93
- data/lib/synvert/snippets/rails/upgrade_3_0_to_3_1.rb +0 -135
- data/lib/synvert/snippets/rails/upgrade_3_1_to_3_2.rb +0 -42
- data/lib/synvert/snippets/rails/upgrade_3_2_to_4_0.rb +0 -230
- data/lib/synvert/snippets/rspec/be_close_to_be_within.rb +0 -18
- data/lib/synvert/snippets/rspec/block_to_expect.rb +0 -22
- data/lib/synvert/snippets/rspec/boolean_matcher.rb +0 -20
- data/lib/synvert/snippets/rspec/collection_matcher.rb +0 -34
- data/lib/synvert/snippets/rspec/its_to_it.rb +0 -89
- data/lib/synvert/snippets/rspec/message_expectation.rb +0 -41
- data/lib/synvert/snippets/rspec/method_stub.rb +0 -84
- data/lib/synvert/snippets/rspec/negative_error_expectation.rb +0 -21
- data/lib/synvert/snippets/rspec/new_syntax.rb +0 -18
- data/lib/synvert/snippets/rspec/one_liner_expectation.rb +0 -71
- data/lib/synvert/snippets/rspec/should_to_expect.rb +0 -50
- data/lib/synvert/snippets/rspec/stub_and_mock_to_double.rb +0 -22
- data/lib/synvert/snippets/ruby/new_hash_syntax.rb +0 -21
- data/lib/synvert/snippets/ruby/new_lambda_syntax.rb +0 -20
- data/spec/spec_helper.rb +0 -26
- data/spec/support/parser_helper.rb +0 -5
- data/spec/synvert/node_ext_spec.rb +0 -201
- data/spec/synvert/rewriter/action_spec.rb +0 -225
- data/spec/synvert/rewriter/condition_spec.rb +0 -106
- data/spec/synvert/rewriter/gem_spec_spec.rb +0 -52
- data/spec/synvert/rewriter/instance_spec.rb +0 -163
- data/spec/synvert/rewriter/scope_spec.rb +0 -42
- data/spec/synvert/rewriter_spec.rb +0 -153
- data/spec/synvert/snippets/factory_girl/syntax_methods_spec.rb +0 -154
- data/spec/synvert/snippets/rails/convert_dynamic_finders_spec.rb +0 -83
- data/spec/synvert/snippets/rails/strong_parameters_spec.rb +0 -132
- data/spec/synvert/snippets/rails/upgrade_3_0_to_3_1_spec.rb +0 -88
- data/spec/synvert/snippets/rails/upgrade_3_1_to_3_2_spec.rb +0 -41
- data/spec/synvert/snippets/rails/upgrade_3_2_to_4_0_spec.rb +0 -299
- data/spec/synvert/snippets/rspec/new_syntax_spec.rb +0 -183
- data/spec/synvert/snippets/ruby/new_hash_syntax_spec.rb +0 -27
- data/spec/synvert/snippets/ruby/new_lambda_syntax_spec.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8fb6fc095299f42a4e1aa2f9edf611f9fa20bd8
|
4
|
+
data.tar.gz: ca35e5cad1e089c9f7717a22a1de4f4f07dc0371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466f9e2ee560b26d06c5aa0d983449ac4f9d19b01418dccc1ac1c7fc2ef87341b95f4b05f8567bcabc4efca5f4d8c096bcbc8e925cc3b8500459312e0e73af28
|
7
|
+
data.tar.gz: 273a870cb6390a1c212273facb08e70b521a5a41a7cc40eaf0cea6df32627686bc4ff83f35dd0e5511c6cfdde1fdb784604f1701eef70234cbbd00d56c6e407b
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,11 +24,12 @@ $ gem install synvert
|
|
24
24
|
```
|
25
25
|
$ synvert -h
|
26
26
|
Usage: synvert [project_path]
|
27
|
-
-d, --load SNIPPET_PATHS load
|
27
|
+
-d, --load SNIPPET_PATHS load custom snippets, snippet paths can be local file path or remote http url
|
28
28
|
-l, --list list all available snippets
|
29
29
|
-q, --query QUERY query specified snippets
|
30
30
|
--skip FILE_PATTERNS skip specified files or directories, separated by comma, e.g. app/models/post.rb,vendor/plugins/**/*.rb
|
31
31
|
-s, --show SNIPPET_NAME show specified snippet description
|
32
|
+
--sync sync snippets
|
32
33
|
-r, --run SNIPPET_NAMES run specified snippets
|
33
34
|
-v, --version show this version
|
34
35
|
```
|
@@ -36,7 +37,7 @@ Usage: synvert [project_path]
|
|
36
37
|
e.g.
|
37
38
|
|
38
39
|
```
|
39
|
-
$ synvert
|
40
|
+
$ synvert --sync
|
40
41
|
```
|
41
42
|
|
42
43
|
```
|
@@ -45,32 +46,11 @@ $ synvert -r factory_girl_short_syntax,upgrade_rails_3_2_to_4_0 ~/Sites/railsbp/
|
|
45
46
|
|
46
47
|
## Snippets
|
47
48
|
|
48
|
-
|
49
|
-
--- | ---
|
50
|
-
factory_girl_short_syntax | FactoryGirl uses short syntax
|
51
|
-
convert_rails_dynamic_finders | Convert rails dynamic finders
|
52
|
-
strong_parameters | Use strong_parameters syntax
|
53
|
-
upgrade_rails_3_0_to_3_1 | Upgrade rails from 3.0 to 3.1
|
54
|
-
upgrade_rails_3_1_to_3_2 | Upgrade rails from 3.1 to 3.2
|
55
|
-
upgrade_rails_3_2_to_4_0 | Upgrade rails from 3.2 to 4.0, it contains convert_dynamic_finder and strong_parameters snippets
|
56
|
-
convert_rspec_be_close_to_be_within | RSpec converts be_close to be_within
|
57
|
-
convert_rspec_block_to_expect | RSpec converts block to expect
|
58
|
-
convert_rspec_boolean_matcher | RSpec converts boolean matcher
|
59
|
-
convert_rspec_collection_matcher | RSpec converts collection matcher
|
60
|
-
convert_rspec_its_to_it | RSpec converts its to it
|
61
|
-
convert_rspec_message_expectation | RSpec converts message expectation
|
62
|
-
convert_rspec_method_stub | RSpec converts method stub
|
63
|
-
convert_rspec_negative_error_expectation | RSpec converts negative error expectation
|
64
|
-
rspec_new_syntax | Use RSpec new syntax, it contains all convert_rspec_* snippets
|
65
|
-
convert_rspec_one_liner_expectation | RSpec converts one liner expectation
|
66
|
-
convert_rspec_should_to_expect | RSpec converts should to expect
|
67
|
-
convert_rspec_stub_and_mock_to_double | RSpec converts stub and mock to double
|
68
|
-
ruby_new_hash_syntax | Ruby uses new hash syntax
|
69
|
-
ruby_new_lambda_syntax | Ruby uses new lambda syntax
|
49
|
+
[https://github.com/xinminlabs/synvert-snippets/][1]
|
70
50
|
|
71
51
|
## Documentation
|
72
52
|
|
73
|
-
[http://xinminlabs.github.io/synvert/][
|
53
|
+
[http://xinminlabs.github.io/synvert/][2]
|
74
54
|
|
75
55
|
## Contributing
|
76
56
|
|
@@ -80,4 +60,5 @@ ruby_new_lambda_syntax | Ruby uses new lambda syntax
|
|
80
60
|
4. Push to the branch (`git push origin my-new-feature`)
|
81
61
|
5. Create new Pull Request
|
82
62
|
|
83
|
-
[1]:
|
63
|
+
[1]: https://github.com/xinminlabs/synvert-snippets/
|
64
|
+
[2]: http://xinminlabs.github.io/synvert/
|
data/bin/synvert
CHANGED
data/lib/synvert/cli.rb
CHANGED
@@ -15,8 +15,9 @@ module Synvert
|
|
15
15
|
|
16
16
|
# Initialize a CLI.
|
17
17
|
def initialize
|
18
|
-
@options = {command: 'run',
|
19
|
-
Configuration.instance.set :skip_files, []
|
18
|
+
@options = {command: 'run', custom_snippet_paths: [], snippet_names: []}
|
19
|
+
Core::Configuration.instance.set :skip_files, []
|
20
|
+
Core::Configuration.instance.set :default_snippets_path, File.join(ENV['HOME'], '.synvert')
|
20
21
|
end
|
21
22
|
|
22
23
|
# Run the CLI.
|
@@ -30,10 +31,11 @@ module Synvert
|
|
30
31
|
when 'list' then list_available_rewriters
|
31
32
|
when 'query' then query_available_rewriters
|
32
33
|
when 'show' then show_rewriter
|
34
|
+
when 'sync' then sync_snippets
|
33
35
|
else
|
34
36
|
@options[:snippet_names].each do |snippet_name|
|
35
37
|
puts "===== #{snippet_name} started ====="
|
36
|
-
rewriter = Rewriter.call snippet_name
|
38
|
+
rewriter = Core::Rewriter.call snippet_name
|
37
39
|
puts rewriter.todo if rewriter.todo
|
38
40
|
puts "===== #{snippet_name} done ====="
|
39
41
|
end
|
@@ -58,8 +60,8 @@ module Synvert
|
|
58
60
|
def run_option_parser(args)
|
59
61
|
optparse = OptionParser.new do |opts|
|
60
62
|
opts.banner = "Usage: synvert [project_path]"
|
61
|
-
opts.on '-d', '--load SNIPPET_PATHS', 'load
|
62
|
-
@options[:
|
63
|
+
opts.on '-d', '--load SNIPPET_PATHS', 'load custom snippets, snippet paths can be local file path or remote http url' do |snippet_paths|
|
64
|
+
@options[:custom_snippet_paths] = snippet_paths.split(',').map(&:strip)
|
63
65
|
end
|
64
66
|
opts.on '-l', '--list', 'list all available snippets' do
|
65
67
|
@options[:command] = 'list'
|
@@ -75,30 +77,34 @@ module Synvert
|
|
75
77
|
@options[:command] = 'show'
|
76
78
|
@options[:snippet_name] = snippet_name
|
77
79
|
end
|
80
|
+
opts.on '--sync', 'sync snippets' do
|
81
|
+
@options[:command] = 'sync'
|
82
|
+
end
|
78
83
|
opts.on '-r', '--run SNIPPET_NAMES', 'run specified snippets' do |snippet_names|
|
79
84
|
@options[:snippet_names] = snippet_names.split(',').map(&:strip)
|
80
85
|
end
|
81
86
|
opts.on '-v', '--version', 'show this version' do
|
82
|
-
puts
|
87
|
+
puts Core::VERSION
|
83
88
|
exit
|
84
89
|
end
|
85
90
|
end
|
86
91
|
paths = optparse.parse(args)
|
87
|
-
Configuration.instance.set :path, paths.first || Dir.pwd
|
92
|
+
Core::Configuration.instance.set :path, paths.first || Dir.pwd
|
88
93
|
if @options[:skip_file_patterns] && !@options[:skip_file_patterns].empty?
|
89
94
|
skip_files = @options[:skip_file_patterns].map { |file_pattern|
|
90
|
-
full_file_pattern = File.join(Configuration.instance.get(:path), file_pattern)
|
95
|
+
full_file_pattern = File.join(Core::Configuration.instance.get(:path), file_pattern)
|
91
96
|
Dir.glob(full_file_pattern)
|
92
97
|
}.flatten
|
93
|
-
Configuration.instance.set :skip_files, skip_files
|
98
|
+
Core::Configuration.instance.set :skip_files, skip_files
|
94
99
|
end
|
95
100
|
end
|
96
101
|
|
97
102
|
# Load all rewriters.
|
98
103
|
def load_rewriters
|
99
|
-
|
104
|
+
default_snippets_path = Core::Configuration.instance.get :default_snippets_path
|
105
|
+
Dir.glob(File.join(default_snippets_path, 'lib/**/*.rb')).each { |file| eval(File.read(file)) }
|
100
106
|
|
101
|
-
@options[:
|
107
|
+
@options[:custom_snippet_paths].each do |snippet_path|
|
102
108
|
if snippet_path =~ /^http/
|
103
109
|
uri = URI.parse snippet_path
|
104
110
|
eval(uri.read)
|
@@ -110,7 +116,7 @@ module Synvert
|
|
110
116
|
|
111
117
|
# List and print all available rewriters.
|
112
118
|
def list_available_rewriters
|
113
|
-
Rewriter.availables.each do |rewriter|
|
119
|
+
Core::Rewriter.availables.each do |rewriter|
|
114
120
|
print rewriter.name.to_s + " "
|
115
121
|
end
|
116
122
|
puts
|
@@ -118,7 +124,7 @@ module Synvert
|
|
118
124
|
|
119
125
|
# Query and print available rewriters.
|
120
126
|
def query_available_rewriters
|
121
|
-
Rewriter.availables.each do |rewriter|
|
127
|
+
Core::Rewriter.availables.each do |rewriter|
|
122
128
|
if rewriter.name.include? @options[:query]
|
123
129
|
print rewriter.name + " "
|
124
130
|
end
|
@@ -128,7 +134,7 @@ module Synvert
|
|
128
134
|
|
129
135
|
# Show and print one rewriter.
|
130
136
|
def show_rewriter
|
131
|
-
rewriter = Rewriter.fetch(@options[:snippet_name])
|
137
|
+
rewriter = Core::Rewriter.fetch(@options[:snippet_name])
|
132
138
|
if rewriter
|
133
139
|
rewriter.process_with_sandbox
|
134
140
|
puts rewriter.description
|
@@ -143,5 +149,11 @@ module Synvert
|
|
143
149
|
puts "snippet #{@options[:snippet_name]} not found"
|
144
150
|
end
|
145
151
|
end
|
152
|
+
|
153
|
+
# sync snippets
|
154
|
+
def sync_snippets
|
155
|
+
Snippet.sync
|
156
|
+
puts "synvert snippets are synced"
|
157
|
+
end
|
146
158
|
end
|
147
159
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Synvert
|
4
|
+
# Manage synvert snippets.
|
5
|
+
class Snippet
|
6
|
+
# synchronize snippets from github.
|
7
|
+
def self.sync
|
8
|
+
snippets_path = Core::Configuration.instance.get :default_snippets_path
|
9
|
+
if File.exist?(snippets_path)
|
10
|
+
FileUtils.cd snippets_path
|
11
|
+
`git pull --rebase --quiet`
|
12
|
+
else
|
13
|
+
`git clone https://github.com/xinminlabs/synvert-snippets.git #{snippets_path} --quiet`
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/synvert/version.rb
CHANGED
data/lib/synvert.rb
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require "synvert/version"
|
3
3
|
require 'bundler'
|
4
|
-
require '
|
5
|
-
require 'parser/current'
|
6
|
-
require 'ast'
|
7
|
-
require 'active_support/inflector'
|
8
|
-
require 'synvert/node_ext'
|
4
|
+
require 'synvert/core'
|
9
5
|
|
10
6
|
module Synvert
|
11
|
-
autoload :
|
12
|
-
autoload :
|
13
|
-
autoload :Rewriter, 'synvert/rewriter'
|
14
|
-
autoload :RewriterNotFound, 'synvert/exceptions'
|
15
|
-
autoload :GemfileLockNotFound, 'synvert/exceptions'
|
16
|
-
autoload :MethodNotSupported, 'synvert/exceptions'
|
7
|
+
autoload :CLI, 'synvert/cli'
|
8
|
+
autoload :Snippet, 'synvert/snippet'
|
17
9
|
end
|
data/synvert.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["flyerhzm@gmail.com"]
|
11
11
|
spec.description = %q{synvert is used to convert ruby code to better syntax.}
|
12
12
|
spec.summary = %q{synvert = syntax + convert.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/xinminlabs/synvert"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,8 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "
|
22
|
-
spec.add_runtime_dependency "activesupport"
|
21
|
+
spec.add_runtime_dependency "synvert-core"
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
24
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,31 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04
|
11
|
+
date: 2014-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
14
|
+
name: synvert-core
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
@@ -113,57 +99,10 @@ files:
|
|
113
99
|
- bin/synvert
|
114
100
|
- lib/synvert.rb
|
115
101
|
- lib/synvert/cli.rb
|
116
|
-
- lib/synvert/
|
117
|
-
- lib/synvert/exceptions.rb
|
118
|
-
- lib/synvert/node_ext.rb
|
119
|
-
- lib/synvert/rewriter.rb
|
120
|
-
- lib/synvert/rewriter/action.rb
|
121
|
-
- lib/synvert/rewriter/condition.rb
|
122
|
-
- lib/synvert/rewriter/gem_spec.rb
|
123
|
-
- lib/synvert/rewriter/instance.rb
|
124
|
-
- lib/synvert/rewriter/scope.rb
|
125
|
-
- lib/synvert/snippets/check_syntax.rb
|
126
|
-
- lib/synvert/snippets/factory_girl/syntax_methods.rb
|
127
|
-
- lib/synvert/snippets/rails/convert_dynamic_finders.rb
|
128
|
-
- lib/synvert/snippets/rails/strong_parameters.rb
|
129
|
-
- lib/synvert/snippets/rails/upgrade_3_0_to_3_1.rb
|
130
|
-
- lib/synvert/snippets/rails/upgrade_3_1_to_3_2.rb
|
131
|
-
- lib/synvert/snippets/rails/upgrade_3_2_to_4_0.rb
|
132
|
-
- lib/synvert/snippets/rspec/be_close_to_be_within.rb
|
133
|
-
- lib/synvert/snippets/rspec/block_to_expect.rb
|
134
|
-
- lib/synvert/snippets/rspec/boolean_matcher.rb
|
135
|
-
- lib/synvert/snippets/rspec/collection_matcher.rb
|
136
|
-
- lib/synvert/snippets/rspec/its_to_it.rb
|
137
|
-
- lib/synvert/snippets/rspec/message_expectation.rb
|
138
|
-
- lib/synvert/snippets/rspec/method_stub.rb
|
139
|
-
- lib/synvert/snippets/rspec/negative_error_expectation.rb
|
140
|
-
- lib/synvert/snippets/rspec/new_syntax.rb
|
141
|
-
- lib/synvert/snippets/rspec/one_liner_expectation.rb
|
142
|
-
- lib/synvert/snippets/rspec/should_to_expect.rb
|
143
|
-
- lib/synvert/snippets/rspec/stub_and_mock_to_double.rb
|
144
|
-
- lib/synvert/snippets/ruby/new_hash_syntax.rb
|
145
|
-
- lib/synvert/snippets/ruby/new_lambda_syntax.rb
|
102
|
+
- lib/synvert/snippet.rb
|
146
103
|
- lib/synvert/version.rb
|
147
|
-
- spec/spec_helper.rb
|
148
|
-
- spec/support/parser_helper.rb
|
149
|
-
- spec/synvert/node_ext_spec.rb
|
150
|
-
- spec/synvert/rewriter/action_spec.rb
|
151
|
-
- spec/synvert/rewriter/condition_spec.rb
|
152
|
-
- spec/synvert/rewriter/gem_spec_spec.rb
|
153
|
-
- spec/synvert/rewriter/instance_spec.rb
|
154
|
-
- spec/synvert/rewriter/scope_spec.rb
|
155
|
-
- spec/synvert/rewriter_spec.rb
|
156
|
-
- spec/synvert/snippets/factory_girl/syntax_methods_spec.rb
|
157
|
-
- spec/synvert/snippets/rails/convert_dynamic_finders_spec.rb
|
158
|
-
- spec/synvert/snippets/rails/strong_parameters_spec.rb
|
159
|
-
- spec/synvert/snippets/rails/upgrade_3_0_to_3_1_spec.rb
|
160
|
-
- spec/synvert/snippets/rails/upgrade_3_1_to_3_2_spec.rb
|
161
|
-
- spec/synvert/snippets/rails/upgrade_3_2_to_4_0_spec.rb
|
162
|
-
- spec/synvert/snippets/rspec/new_syntax_spec.rb
|
163
|
-
- spec/synvert/snippets/ruby/new_hash_syntax_spec.rb
|
164
|
-
- spec/synvert/snippets/ruby/new_lambda_syntax_spec.rb
|
165
104
|
- synvert.gemspec
|
166
|
-
homepage:
|
105
|
+
homepage: https://github.com/xinminlabs/synvert
|
167
106
|
licenses:
|
168
107
|
- MIT
|
169
108
|
metadata: {}
|
@@ -187,22 +126,4 @@ rubygems_version: 2.2.2
|
|
187
126
|
signing_key:
|
188
127
|
specification_version: 4
|
189
128
|
summary: synvert = syntax + convert.
|
190
|
-
test_files:
|
191
|
-
- spec/spec_helper.rb
|
192
|
-
- spec/support/parser_helper.rb
|
193
|
-
- spec/synvert/node_ext_spec.rb
|
194
|
-
- spec/synvert/rewriter/action_spec.rb
|
195
|
-
- spec/synvert/rewriter/condition_spec.rb
|
196
|
-
- spec/synvert/rewriter/gem_spec_spec.rb
|
197
|
-
- spec/synvert/rewriter/instance_spec.rb
|
198
|
-
- spec/synvert/rewriter/scope_spec.rb
|
199
|
-
- spec/synvert/rewriter_spec.rb
|
200
|
-
- spec/synvert/snippets/factory_girl/syntax_methods_spec.rb
|
201
|
-
- spec/synvert/snippets/rails/convert_dynamic_finders_spec.rb
|
202
|
-
- spec/synvert/snippets/rails/strong_parameters_spec.rb
|
203
|
-
- spec/synvert/snippets/rails/upgrade_3_0_to_3_1_spec.rb
|
204
|
-
- spec/synvert/snippets/rails/upgrade_3_1_to_3_2_spec.rb
|
205
|
-
- spec/synvert/snippets/rails/upgrade_3_2_to_4_0_spec.rb
|
206
|
-
- spec/synvert/snippets/rspec/new_syntax_spec.rb
|
207
|
-
- spec/synvert/snippets/ruby/new_hash_syntax_spec.rb
|
208
|
-
- spec/synvert/snippets/ruby/new_lambda_syntax_spec.rb
|
129
|
+
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'singleton'
|
3
|
-
|
4
|
-
module Synvert
|
5
|
-
# Synvert global configuration.
|
6
|
-
class Configuration < Hash
|
7
|
-
include Singleton
|
8
|
-
|
9
|
-
# Set the configuration.
|
10
|
-
#
|
11
|
-
# @param key [String] configuration key.
|
12
|
-
# @param value [Object] configuration value.
|
13
|
-
def set(key, value)
|
14
|
-
self[key] = value
|
15
|
-
end
|
16
|
-
|
17
|
-
# Get the configuration.
|
18
|
-
#
|
19
|
-
# @param key [String] configuration key.
|
20
|
-
# @return [Object] configuration value.
|
21
|
-
def get(key)
|
22
|
-
self[key]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/synvert/exceptions.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
module Synvert
|
2
|
-
# Rewriter not found exception.
|
3
|
-
class RewriterNotFound < Exception
|
4
|
-
end
|
5
|
-
|
6
|
-
# Gemfile.lock not found exception.
|
7
|
-
class GemfileLockNotFound < Exception
|
8
|
-
end
|
9
|
-
|
10
|
-
# Method not supported exception.
|
11
|
-
class MethodNotSupported < Exception
|
12
|
-
end
|
13
|
-
end
|