cxf_formatter 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/README.md +8 -9
- data/exe/cxf_formatter +0 -0
- data/lib/cxf_formatter.rb +6 -0
- data/lib/cxf_formatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81eef8ee504b8ca9bfffc55a117fcc42e2875061
|
4
|
+
data.tar.gz: 9160e0feb1dcab843b2e07b7f95b74d5d35f2b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a14b79dd6e854f9ca3c192792457ddbf9cacb7c9583dd07773909b9d56fdba5493b11b970ca80e5f0d7e8826a6fa8b7aae04222df3eec50d572697d80e22e3b
|
7
|
+
data.tar.gz: f3669a6cbc37bec34d4cff2439b11e06260ead6228c2c49ae32cd24906a042319a67db999dd4943116797eb7369a1c683d936547bdbc64881d63bab573a9d656
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# CxfFormatter
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This gem can be used to cleanup and do more consistent formatting of generated CXF Java classes
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,12 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```ruby
|
24
|
+
CxfFormatter::clean # run from working directory
|
25
|
+
CxfFormatter::clean(path_to_clean) # clean specific path
|
26
|
+
```
|
27
|
+
|
28
|
+
There is also a executable `cxf_formatter`
|
26
29
|
|
27
30
|
## Development
|
28
31
|
|
@@ -32,8 +35,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
35
|
|
33
36
|
## Contributing
|
34
37
|
|
35
|
-
|
36
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
-
5. Create a new Pull Request
|
38
|
+
Contact met via https://rubygems.org/profiles/onknows
|
data/exe/cxf_formatter
CHANGED
File without changes
|
data/lib/cxf_formatter.rb
CHANGED
@@ -3,7 +3,10 @@ require 'cxf_formatter/version'
|
|
3
3
|
# Just one module with one method
|
4
4
|
module CxfFormatter
|
5
5
|
def clean(path)
|
6
|
+
path = '.' if path.nil?
|
6
7
|
path = path.tr('\\', '/') if Gem.win_platform?
|
8
|
+
path = File.expand_path(path)
|
9
|
+
puts "Cleaning sources in path #{path}"
|
7
10
|
Dir.chdir(path) do
|
8
11
|
Dir.glob('./**/*.java') do |p|
|
9
12
|
src = File.read p
|
@@ -21,6 +24,7 @@ module CxfFormatter
|
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
27
|
+
module_function :clean
|
24
28
|
|
25
29
|
# Sort @XmlElementRefs in a consistent way
|
26
30
|
def clean_xml_elem_refs(new_src)
|
@@ -42,6 +46,7 @@ module CxfFormatter
|
|
42
46
|
end
|
43
47
|
new_src
|
44
48
|
end
|
49
|
+
module_function :clean_xml_elem_refs
|
45
50
|
|
46
51
|
def clean_objectfactory_java(basename, new_src)
|
47
52
|
return new_src unless basename == 'ObjectFactory.java'
|
@@ -87,4 +92,5 @@ module CxfFormatter
|
|
87
92
|
puts " Sorting #{snippets2.count} public methods"
|
88
93
|
new_src.sub(:placeholder2.to_s, snippets2.sort.join)
|
89
94
|
end
|
95
|
+
module_function :clean_objectfactory_java
|
90
96
|
end
|