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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 195ef467dcf6865b696f140aba9b762dae5c63bd
4
- data.tar.gz: dff333d3c245fa7778d35c32720798a85a9ceaae
3
+ metadata.gz: 81eef8ee504b8ca9bfffc55a117fcc42e2875061
4
+ data.tar.gz: 9160e0feb1dcab843b2e07b7f95b74d5d35f2b20
5
5
  SHA512:
6
- metadata.gz: ec3e70ef76a652c38f79752fcd29eeb19bf93313d678dcd06cbaf65ed25c8ac47b18ea7c3a4f4ca37aca9f1f8e957387e083c00f144b793022110ec80cfe55b3
7
- data.tar.gz: 7cb2a5b327bed00783f0a4b63cb6866ad189e4e50aaf7582d407dd78c0d8ec7349f75fc825a6cfbae3c1159ef9e366b262f51e252dc0e171c1db27c14e11fb86
6
+ metadata.gz: 3a14b79dd6e854f9ca3c192792457ddbf9cacb7c9583dd07773909b9d56fdba5493b11b970ca80e5f0d7e8826a6fa8b7aae04222df3eec50d572697d80e22e3b
7
+ data.tar.gz: f3669a6cbc37bec34d4cff2439b11e06260ead6228c2c49ae32cd24906a042319a67db999dd4943116797eb7369a1c683d936547bdbc64881d63bab573a9d656
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # CxfFormatter
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cxf_formatter`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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
- 1. Fork it ( https://github.com/[my-github-username]/cxf_formatter/fork )
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
@@ -1,3 +1,3 @@
1
1
  module CxfFormatter
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cxf_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onno