cbratools 0.1.0 → 0.1.1
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/bin/rnc +39 -0
- data/bin/rnm +41 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4511cda18c32b388fe351a57e214b1dd2fb0ea8f
|
4
|
+
data.tar.gz: 52fbce4242df1305736f871ead214706db226bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4673dd2727a4a254d9d1c49f41d577e5a65850f4e4c60469d9fe0481e669ea63608242f3b0b5981d6cccd7e9311457aaaf002428e815355eb906550054d763d4
|
7
|
+
data.tar.gz: dfe0fefbb37c2669e1231b5f2b621c2829397a05c033304cd760bc841381dcb16f6c82d71684777701850fba2892403e3dee9ee56fe312ba40221b32e2e3bed0
|
data/bin/rnc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative "../lib/cbratools"
|
4
|
+
|
5
|
+
def help_text
|
6
|
+
<<-USAGE
|
7
|
+
rnc [-v] CurrentName NewName PATH
|
8
|
+
|
9
|
+
Rename CBRA components.
|
10
|
+
|
11
|
+
Pass no options to see this help text.
|
12
|
+
|
13
|
+
Option -v is for verbose output.
|
14
|
+
USAGE
|
15
|
+
end
|
16
|
+
|
17
|
+
current_name = nil
|
18
|
+
new_name = nil
|
19
|
+
verbose = true
|
20
|
+
|
21
|
+
if ARGV.size == 1 && %w(-h -H --help).include?(ARGV[0])
|
22
|
+
puts help_text
|
23
|
+
exit 0
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
if ARGV.size == 3 || ARGV.size == 4
|
28
|
+
current_name = ARGV[ARGV.size - 3]
|
29
|
+
new_name = ARGV[ARGV.size - 2]
|
30
|
+
path = ARGV[ARGV.size - 1]
|
31
|
+
verbose = ARGV.size == 4 && ARGV[0] == '-v'
|
32
|
+
end
|
33
|
+
|
34
|
+
if !current_name || !new_name || !path
|
35
|
+
puts help_text
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
|
39
|
+
Cbratools::RenameComponent.new(current_name, new_name, path, verbose).run
|
data/bin/rnm
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative "../lib/cbratools"
|
4
|
+
|
5
|
+
def help_text
|
6
|
+
<<-USAGE
|
7
|
+
rnm [-v] CurrentName NewName MIGRATIONS_PATH SCHEMA_FILE_PATH
|
8
|
+
|
9
|
+
Create migrations to support CBRA component rename.
|
10
|
+
|
11
|
+
Pass no options to see this help text.
|
12
|
+
|
13
|
+
Option -v is for verbose output.
|
14
|
+
USAGE
|
15
|
+
end
|
16
|
+
|
17
|
+
current_name = nil
|
18
|
+
new_name = nil
|
19
|
+
migrations_path = nil
|
20
|
+
schema_file_path = nil
|
21
|
+
verbose = true
|
22
|
+
|
23
|
+
if ARGV.size == 0
|
24
|
+
puts help_text
|
25
|
+
exit 0
|
26
|
+
end
|
27
|
+
|
28
|
+
if ARGV.size == 4 || ARGV.size == 5
|
29
|
+
current_name = ARGV[ARGV.size - 4]
|
30
|
+
new_name = ARGV[ARGV.size - 3]
|
31
|
+
migrations_path = ARGV[ARGV.size - 2]
|
32
|
+
schema_file_path = ARGV[ARGV.size - 1]
|
33
|
+
verbose = ARGV.size == 5 && ARGV[0] == '-v'
|
34
|
+
end
|
35
|
+
|
36
|
+
if !current_name || !new_name || !migrations_path || !schema_file_path
|
37
|
+
puts help_text
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
|
41
|
+
Cbratools::ComponentNameChangeMigrations.new(current_name, new_name, migrations_path, schema_file_path).add
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbratools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephan Hagemann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,12 +47,16 @@ dependencies:
|
|
47
47
|
description: A set of tools to help with refactorings in component-based Rails applications.
|
48
48
|
email:
|
49
49
|
- stephan.hagemann@gmail.com
|
50
|
-
executables:
|
50
|
+
executables:
|
51
|
+
- rnc
|
52
|
+
- rnm
|
51
53
|
extensions: []
|
52
54
|
extra_rdoc_files: []
|
53
55
|
files:
|
54
56
|
- README.md
|
55
57
|
- Rakefile
|
58
|
+
- bin/rnc
|
59
|
+
- bin/rnm
|
56
60
|
- lib/cbratools.rb
|
57
61
|
- lib/cbratools/component_name_change_migrations.rb
|
58
62
|
- lib/cbratools/rename_component.rb
|
@@ -77,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
81
|
version: '0'
|
78
82
|
requirements: []
|
79
83
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.6.13
|
81
85
|
signing_key:
|
82
86
|
specification_version: 4
|
83
87
|
summary: cbratools
|