codeshift 0.1.8 → 0.1.9
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/README.md +4 -4
- data/lib/codeshift/cli.rb +2 -1
- data/lib/codeshift/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dc90b2206d515493277afb92c4bfa45e6acad0ac7cd305ee9dae743d31e3250
|
4
|
+
data.tar.gz: f8741ad46f12f53c8668c04112257d82f565895c320819258e7e4ab250bf4a1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e798664f8e3489bfb1301642bf0826a6f2612696e4004cafcdbee8f13869c2833fad9d941f7e61ac0576de3c3e16fcaff326f041b758e9f07e1d919c4004cd78
|
7
|
+
data.tar.gz: 9037feda2b9d933f45d2505bac0e5229e7413c1e4fa139babd336fba42b87528afd9dc3ff8cea10da3a59a0a14adc7c1bd4d6624f0e0657694ef7ef5e03d6eeb
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ $ codeshift -t [TRANSFORM FILE] [PATHS]
|
|
23
23
|
To apply the transform logic on your `app/models` files
|
24
24
|
|
25
25
|
```sh
|
26
|
-
$ codeshift -t transform.rb app/models
|
26
|
+
$ codeshift -t transform.rb app/models
|
27
27
|
```
|
28
28
|
|
29
29
|
For example if you want to reverse the local variable names and method names in your code
|
@@ -63,7 +63,7 @@ end
|
|
63
63
|
Then use it against your source code
|
64
64
|
|
65
65
|
```sh
|
66
|
-
$ codeshift -t transform.rb ~/Desktop/test/ruby
|
66
|
+
$ codeshift -t transform.rb ~/Desktop/test/ruby
|
67
67
|
```
|
68
68
|
|
69
69
|
Then your source will be transformed something like:
|
@@ -88,14 +88,14 @@ Usage: codeshift -t <transform-file> [path]
|
|
88
88
|
The transform file could be a local file or a remote url. For example you can use like
|
89
89
|
|
90
90
|
```sh
|
91
|
-
$ codeshift -t https://gist.githubusercontent.com/[user]/.../transform.rb ~/Desktop/test/ruby
|
91
|
+
$ codeshift -t https://gist.githubusercontent.com/[user]/.../transform.rb ~/Desktop/test/ruby
|
92
92
|
```
|
93
93
|
|
94
94
|
### path
|
95
95
|
The path could be a list of directories or files separated by space.
|
96
96
|
|
97
97
|
```sh
|
98
|
-
$ codeshift -t transform.rb ~/app/legacy/ruby
|
98
|
+
$ codeshift -t transform.rb ~/app/legacy/ruby ~/app/old
|
99
99
|
```
|
100
100
|
|
101
101
|
```sh
|
data/lib/codeshift/cli.rb
CHANGED
@@ -46,7 +46,8 @@ module CodeShift
|
|
46
46
|
paths = @files.empty? ? [] : @files
|
47
47
|
paths.each do |path|
|
48
48
|
if File.directory?(path)
|
49
|
-
|
49
|
+
glob_path = File.join(path,'**','*.rb')
|
50
|
+
Dir.glob(glob_path) do |file_path|
|
50
51
|
process_file file_path
|
51
52
|
end
|
52
53
|
else
|
data/lib/codeshift/version.rb
CHANGED