JOT 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,12 +3,14 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  gem "soap4r", ">= 1.5.8"
6
+ gem 'redcarpet', "2.1.1"
6
7
 
7
8
  # Add dependencies to develop your gem here.
8
9
  # Include everything needed to run rake, tests, features, etc.
9
10
  group :development do
10
11
  gem "shoulda", ">= 0"
11
- gem "bundler", "~> 1.0.0"
12
+ gem "bundler", ">= 1.0.0"
12
13
  gem "jeweler", "~> 1.6.4"
13
- gem "rcov", ">= 0"
14
+ #gem "rcov", ">= 0"
14
15
  end
16
+
data/JOT.gemspec ADDED
@@ -0,0 +1,72 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{JOT}
8
+ s.version = "1.0.5"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Darrin Mison"]
12
+ s.date = %q{2012-10-29}
13
+ s.default_executable = %q{JOT}
14
+ s.description = %q{Uses the JIRA SOAP interface to retrieve issues from a JIRA instance for processing with a user specified ERB template.}
15
+ s.email = %q{dmison@me.com}
16
+ s.executables = ["JOT"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.md",
20
+ "README.rdoc"
21
+ ]
22
+ s.files = [
23
+ "Gemfile",
24
+ "JOT.gemspec",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/JOT",
31
+ "example.erb",
32
+ "lib/JIRA-SOAP-STUBS/JiraSoapServiceServiceClient.rb",
33
+ "lib/JIRA-SOAP-STUBS/default.rb",
34
+ "lib/JIRA-SOAP-STUBS/defaultDriver.rb",
35
+ "lib/JIRA-SOAP-STUBS/defaultMappingRegistry.rb",
36
+ "lib/jira_soap_extensions.rb",
37
+ "lib/string_extensions.rb",
38
+ "test/helper.rb",
39
+ "test/test_JOT.rb"
40
+ ]
41
+ s.homepage = %q{http://github.com/dmison/JOT}
42
+ s.licenses = ["MIT"]
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = %q{1.3.6}
45
+ s.summary = %q{CLI for retreiving issues from a JIRA instance and formatting the data.}
46
+
47
+ if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
+ s.specification_version = 3
50
+
51
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<soap4r>, [">= 1.5.8"])
53
+ s.add_runtime_dependency(%q<redcarpet>, ["= 2.1.1"])
54
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
56
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
57
+ else
58
+ s.add_dependency(%q<soap4r>, [">= 1.5.8"])
59
+ s.add_dependency(%q<redcarpet>, ["= 2.1.1"])
60
+ s.add_dependency(%q<shoulda>, [">= 0"])
61
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
62
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
63
+ end
64
+ else
65
+ s.add_dependency(%q<soap4r>, [">= 1.5.8"])
66
+ s.add_dependency(%q<redcarpet>, ["= 2.1.1"])
67
+ s.add_dependency(%q<shoulda>, [">= 0"])
68
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
69
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
70
+ end
71
+ end
72
+
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # ABOUT
2
- This is a Ruby script that uses SOAP to retrieve issues from a JIRA instance and pumps them into
3
- a customizable ERB template.
2
+ This is a Ruby script that uses SOAP to retrieve issues from the JBoss JIRA instance and pumps them into
3
+ a customizable ERB template. Right now it is hardcoded to issues.jboss.org ... I really need to look into
4
+ dynamic creation of the SOAP stubs etc.
4
5
 
5
6
  # TESTED ON
6
7
 
7
- * Ruby 1.8.7 on Mac OSX Snow Leopard and Lion.
8
+ * Ruby 1.8.7 on Mac OSX v10.6, v10.7, v10.8.
8
9
  * Ruby 1.8.6 on Fedora 13 64bit
9
10
 
11
+ DOES NOT WORK ON RUBY 1.9.X
12
+
10
13
  # INSTALLING
11
14
  1. Ensure Ruby and RubyGems are installed
12
15
  * On Fedora installing RubyGems will install Ruby as a dependency:
data/Rakefile CHANGED
@@ -36,27 +36,27 @@ Jeweler::RubygemsDotOrgTasks.new
36
36
 
37
37
  require 'rake/testtask'
38
38
  Rake::TestTask.new(:test) do |test|
39
- test.libs << 'lib' << 'test'
39
+ test.libs << 'lib' << 'test' << 'bin'
40
40
  test.pattern = 'test/**/test_*.rb'
41
41
  test.verbose = true
42
42
  end
43
43
 
44
- require 'rcov/rcovtask'
45
- Rcov::RcovTask.new do |test|
46
- test.libs << 'test'
47
- test.pattern = 'test/**/test_*.rb'
48
- test.verbose = true
49
- test.rcov_opts << '--exclude "gems/*"'
50
- end
44
+ # require 'rcov/rcovtask'
45
+ # Rcov::RcovTask.new do |test|
46
+ # test.libs << 'test'
47
+ # test.pattern = 'test/**/test_*.rb'
48
+ # test.verbose = true
49
+ # test.rcov_opts << '--exclude "gems/*"'
50
+ # end
51
51
 
52
52
  task :default => :test
53
53
 
54
- require 'rake/rdoctask'
55
- Rake::RDocTask.new do |rdoc|
56
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
54
+ # require 'rake/rdoctask'
55
+ # Rake::RDocTask.new do |rdoc|
56
+ # version = File.exist?('VERSION') ? File.read('VERSION') : ""
57
57
 
58
- rdoc.rdoc_dir = 'rdoc'
59
- rdoc.title = "JOT #{version}"
60
- rdoc.rdoc_files.include('README*')
61
- rdoc.rdoc_files.include('lib/**/*.rb')
62
- end
58
+ # rdoc.rdoc_dir = 'rdoc'
59
+ # rdoc.title = "JOT #{version}"
60
+ # rdoc.rdoc_files.include('README*')
61
+ # rdoc.rdoc_files.include('lib/**/*.rb')
62
+ # end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.5
data/bin/JOT CHANGED
@@ -7,7 +7,9 @@ require 'soap/driver'
7
7
  require 'optparse'
8
8
 
9
9
  require 'JIRA-SOAP-STUBS/defaultDriver.rb'
10
- require 'extension_methods.rb'
10
+
11
+ require 'string_extensions.rb'
12
+ require 'jira_soap_extensions.rb'
11
13
 
12
14
  #http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html
13
15
  #wsdl2ruby.rb --wsdl http://issues.jboss.org/rpc/soap/jirasoapservice-v2?wsdl --type=client --module JIRA
@@ -77,7 +79,7 @@ def processCommandLine
77
79
  options = {}
78
80
 
79
81
  optparse = OptionParser.new do |opts|
80
- opts.banner = "JOT [options]"
82
+ opts.banner = "JOT v1.0.5"
81
83
 
82
84
  options[:getSecurityLevels] = false
83
85
  opts.on( '-s', '--security', 'Retrieve security levels. Slow, don''t do it unless necessary' ) do
@@ -0,0 +1,12 @@
1
+ #============= JIRA::RemoteIssue
2
+
3
+ class JIRA::RemoteIssue
4
+ def getCustomFieldValueForID(passedID)
5
+ self.customFieldValues.each do |field|
6
+ if field.customfieldId == passedID then
7
+ return field.values[0]
8
+ end
9
+ end
10
+ return nil
11
+ end
12
+ end
@@ -0,0 +1,58 @@
1
+ require "Redcarpet"
2
+
3
+ # ============= String
4
+ class String
5
+ def to_x
6
+ text = self
7
+ text = text.gsub("&","&amp;")
8
+ text = text.gsub("<","&lt;")
9
+ text = text.gsub(">","&gt;")
10
+ return text
11
+ end
12
+
13
+ def md_to_html
14
+ text = self
15
+ options = [:hard_wrap, :autolink, :no_intra_emphasis]
16
+ renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
17
+ renderer.render(text)
18
+ end
19
+
20
+ def html_to_docbook
21
+
22
+ text = self
23
+
24
+ # p,en,li tags can't open and close on new lines only
25
+ text.gsub!(/\n^<\/([p|em|li]*?)>/, "</\\1>")
26
+ text.gsub!(/^<([p|em|li]*?)>\n/, "<\\1>")
27
+
28
+ # ensure the code/pre tag combo doesn't open and close on different lines
29
+ text.gsub!(/\n^(<\/code><\/pre>*)/, "</code></pre>")
30
+ text.gsub!(/(<pre><code>)\n/, "\\1")
31
+
32
+ # turn <p> into <para>
33
+ text.gsub!(/<p>(.*?)<\/p>/m, "<para>\\1</para>")
34
+
35
+
36
+ # turn <em> into <emphasis>
37
+ # text.gsub!(/<em>(.*)<\/em>/, "<emphasis>\\1</emphasis>")
38
+
39
+ text.gsub!(/<pre><code>(.*?)<\/code><\/pre>/m, "<screen>\\1</screen>")
40
+
41
+ # ordered and itemized lists
42
+ text.gsub!(/<ul>(.*?)<\/ul>/m, "<itemizedlist>\\1</itemizedlist>")
43
+ text.gsub!(/<ol>(.*?)<\/ol>/m, "<orderedlist>\\1</orderedlist>")
44
+ text.gsub!(/<li>(.*?)<\/li>/m, "<listitem><para>\\1</para></listitem>")
45
+
46
+ return text
47
+
48
+ end
49
+
50
+ def md_to_docbook
51
+
52
+ text = self
53
+ text = text.md_to_html
54
+ text = text.html_to_docbook
55
+ return text
56
+ end
57
+
58
+ end
data/test/helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+
3
4
  begin
4
5
  Bundler.setup(:default, :development)
5
6
  rescue Bundler::BundlerError => e
@@ -7,12 +8,15 @@ rescue Bundler::BundlerError => e
7
8
  $stderr.puts "Run `bundle install` to install missing gems"
8
9
  exit e.status_code
9
10
  end
11
+
10
12
  require 'test/unit'
11
13
  require 'shoulda'
12
14
 
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'JOT'
15
+ #$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
16
+ #$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'bin'))
17
+ #$LOAD_PATH.unshift File.dirname(__FILE__)
18
+
16
19
 
17
20
  class Test::Unit::TestCase
21
+
18
22
  end
data/test/test_JOT.rb CHANGED
@@ -1,7 +1,31 @@
1
1
  require 'helper'
2
2
 
3
+ require 'string_extensions.rb'
4
+
3
5
  class TestJot < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ # should "probably rename this file and start testing for real" do
7
+ # flunk "hey buddy, you should probably rename this file and start testing for real"
8
+ # end
9
+
10
+
11
+ should "test ` to <code> with md_to_docbook" do
12
+ teststring = "use the `testMe` command"
13
+ expected = "use the <code>testMe</code> command"
14
+ assert_equal expected, teststring.md_to_docbook
15
+ end
16
+
17
+ should "test line breaks to <para>s" do
18
+ testinput = "this is a test
19
+ of multiline input.
20
+
21
+ In addition to a test of para breaks."
22
+
23
+ expected = "<para>this is a test
24
+ of multiline input.</para>
25
+
26
+ <para>In addition to a test of para breaks.</para>"
27
+
28
+ assert_equal expected, testinput.linebreak_to_para_to_docbook
6
29
  end
30
+
7
31
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: JOT
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 0
9
- - 4
10
- version: 1.0.4
8
+ - 5
9
+ version: 1.0.5
11
10
  platform: ruby
12
11
  authors:
13
12
  - Darrin Mison
@@ -15,83 +14,76 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-09-29 00:00:00 Z
17
+ date: 2012-10-29 00:00:00 +10:00
18
+ default_executable: JOT
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :runtime
23
+ name: soap4r
21
24
  version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
25
  requirements:
24
26
  - - ">="
25
27
  - !ruby/object:Gem::Version
26
- hash: 19
27
28
  segments:
28
29
  - 1
29
30
  - 5
30
31
  - 8
31
32
  version: 1.5.8
32
- name: soap4r
33
- prerelease: false
34
- type: :runtime
35
33
  requirement: *id001
36
34
  - !ruby/object:Gem::Dependency
35
+ prerelease: false
36
+ type: :runtime
37
+ name: redcarpet
37
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
+ requirements:
40
+ - - "="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 2
44
+ - 1
45
+ - 1
46
+ version: 2.1.1
47
+ requirement: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ prerelease: false
50
+ type: :development
51
+ name: shoulda
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
39
53
  requirements:
40
54
  - - ">="
41
55
  - !ruby/object:Gem::Version
42
- hash: 3
43
56
  segments:
44
57
  - 0
45
58
  version: "0"
46
- name: shoulda
59
+ requirement: *id003
60
+ - !ruby/object:Gem::Dependency
47
61
  prerelease: false
48
62
  type: :development
49
- requirement: *id002
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- none: false
63
+ name: bundler
64
+ version_requirements: &id004 !ruby/object:Gem::Requirement
53
65
  requirements:
54
- - - ~>
66
+ - - ">="
55
67
  - !ruby/object:Gem::Version
56
- hash: 23
57
68
  segments:
58
69
  - 1
59
70
  - 0
60
71
  - 0
61
72
  version: 1.0.0
62
- name: bundler
73
+ requirement: *id004
74
+ - !ruby/object:Gem::Dependency
63
75
  prerelease: false
64
76
  type: :development
65
- requirement: *id003
66
- - !ruby/object:Gem::Dependency
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
68
- none: false
77
+ name: jeweler
78
+ version_requirements: &id005 !ruby/object:Gem::Requirement
69
79
  requirements:
70
80
  - - ~>
71
81
  - !ruby/object:Gem::Version
72
- hash: 7
73
82
  segments:
74
83
  - 1
75
84
  - 6
76
85
  - 4
77
86
  version: 1.6.4
78
- name: jeweler
79
- prerelease: false
80
- type: :development
81
- requirement: *id004
82
- - !ruby/object:Gem::Dependency
83
- version_requirements: &id005 !ruby/object:Gem::Requirement
84
- none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
92
- name: rcov
93
- prerelease: false
94
- type: :development
95
87
  requirement: *id005
96
88
  description: Uses the JIRA SOAP interface to retrieve issues from a JIRA instance for processing with a user specified ERB template.
97
89
  email: dmison@me.com
@@ -105,6 +97,7 @@ extra_rdoc_files:
105
97
  - README.rdoc
106
98
  files:
107
99
  - Gemfile
100
+ - JOT.gemspec
108
101
  - LICENSE.txt
109
102
  - README.md
110
103
  - README.rdoc
@@ -116,9 +109,11 @@ files:
116
109
  - lib/JIRA-SOAP-STUBS/default.rb
117
110
  - lib/JIRA-SOAP-STUBS/defaultDriver.rb
118
111
  - lib/JIRA-SOAP-STUBS/defaultMappingRegistry.rb
119
- - lib/extension_methods.rb
112
+ - lib/jira_soap_extensions.rb
113
+ - lib/string_extensions.rb
120
114
  - test/helper.rb
121
115
  - test/test_JOT.rb
116
+ has_rdoc: true
122
117
  homepage: http://github.com/dmison/JOT
123
118
  licenses:
124
119
  - MIT
@@ -128,27 +123,23 @@ rdoc_options: []
128
123
  require_paths:
129
124
  - lib
130
125
  required_ruby_version: !ruby/object:Gem::Requirement
131
- none: false
132
126
  requirements:
133
127
  - - ">="
134
128
  - !ruby/object:Gem::Version
135
- hash: 3
136
129
  segments:
137
130
  - 0
138
131
  version: "0"
139
132
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
133
  requirements:
142
134
  - - ">="
143
135
  - !ruby/object:Gem::Version
144
- hash: 3
145
136
  segments:
146
137
  - 0
147
138
  version: "0"
148
139
  requirements: []
149
140
 
150
141
  rubyforge_project:
151
- rubygems_version: 1.8.10
142
+ rubygems_version: 1.3.6
152
143
  signing_key:
153
144
  specification_version: 3
154
145
  summary: CLI for retreiving issues from a JIRA instance and formatting the data.
@@ -1,22 +0,0 @@
1
- # ============= JIRA::RemoteIssue
2
- class JIRA::RemoteIssue
3
- def getCustomFieldValueForID(passedID)
4
- self.customFieldValues.each do |field|
5
- if field.customfieldId == passedID then
6
- return field.values[0]
7
- end
8
- end
9
- return nil
10
- end
11
- end
12
-
13
- # ============= String
14
- class String
15
- def to_x
16
- text = self
17
- text = text.gsub("&","&amp;")
18
- text = text.gsub("<","&lt;")
19
- text = text.gsub(">","&gt;")
20
- return text
21
- end
22
- end