roart 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,54 @@
1
+
2
+ if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
3
+ require 'spec/rake/verify_rcov'
4
+
5
+ namespace :spec do
6
+
7
+ desc 'Run all specs with basic output'
8
+ Spec::Rake::SpecTask.new(:run) do |t|
9
+ t.ruby_opts = PROJ.ruby_opts
10
+ t.spec_opts = PROJ.spec.opts
11
+ t.spec_files = PROJ.spec.files
12
+ t.libs += PROJ.libs
13
+ end
14
+
15
+ desc 'Run all specs with text output'
16
+ Spec::Rake::SpecTask.new(:specdoc) do |t|
17
+ t.ruby_opts = PROJ.ruby_opts
18
+ t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
19
+ t.spec_files = PROJ.spec.files
20
+ t.libs += PROJ.libs
21
+ end
22
+
23
+ if HAVE_RCOV
24
+ desc 'Run all specs with RCov'
25
+ Spec::Rake::SpecTask.new(:rcov) do |t|
26
+ t.ruby_opts = PROJ.ruby_opts
27
+ t.spec_opts = PROJ.spec.opts
28
+ t.spec_files = PROJ.spec.files
29
+ t.libs += PROJ.libs
30
+ t.rcov = true
31
+ t.rcov_dir = PROJ.rcov.dir
32
+ t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
33
+ end
34
+
35
+ RCov::VerifyTask.new(:verify) do |t|
36
+ t.threshold = PROJ.rcov.threshold
37
+ t.index_html = File.join(PROJ.rcov.dir, 'index.html')
38
+ t.require_exact_threshold = PROJ.rcov.threshold_exact
39
+ end
40
+
41
+ task :verify => :rcov
42
+ remove_desc_for_task %w(spec:clobber_rcov)
43
+ end
44
+
45
+ end # namespace :spec
46
+
47
+ desc 'Alias to spec:run'
48
+ task :spec => 'spec:run'
49
+
50
+ task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
51
+
52
+ end # if HAVE_SPEC_RAKE_SPECTASK
53
+
54
+ # EOF
@@ -0,0 +1,47 @@
1
+
2
+ if HAVE_SVN
3
+
4
+ unless PROJ.svn.root
5
+ info = %x/svn info ./
6
+ m = %r/^Repository Root:\s+(.*)$/.match(info)
7
+ PROJ.svn.root = (m.nil? ? '' : m[1])
8
+ end
9
+ PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
10
+
11
+ namespace :svn do
12
+
13
+ # A prerequisites task that all other tasks depend upon
14
+ task :prereqs
15
+
16
+ desc 'Show tags from the SVN repository'
17
+ task :show_tags => 'svn:prereqs' do |t|
18
+ tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
19
+ tags.gsub!(%r/\/$/, '')
20
+ tags = tags.split("\n").sort {|a,b| b <=> a}
21
+ puts tags
22
+ end
23
+
24
+ desc 'Create a new tag in the SVN repository'
25
+ task :create_tag => 'svn:prereqs' do |t|
26
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
27
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
28
+
29
+ svn = PROJ.svn
30
+ trunk = File.join(svn.root, svn.trunk)
31
+ tag = "%s-%s" % [PROJ.name, PROJ.version]
32
+ tag = File.join(svn.root, svn.tags, tag)
33
+ msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
34
+
35
+ puts "Creating SVN tag '#{tag}'"
36
+ unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
37
+ abort "Tag creation failed"
38
+ end
39
+ end
40
+
41
+ end # namespace :svn
42
+
43
+ task 'gem:release' => 'svn:create_tag'
44
+
45
+ end # if PROJ.svn.path
46
+
47
+ # EOF
@@ -0,0 +1,40 @@
1
+
2
+ if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
3
+ require 'rake/testtask'
4
+
5
+ namespace :test do
6
+
7
+ Rake::TestTask.new(:run) do |t|
8
+ t.libs = PROJ.libs
9
+ t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
10
+ else PROJ.test.files end
11
+ t.ruby_opts += PROJ.ruby_opts
12
+ t.ruby_opts += PROJ.test.opts
13
+ end
14
+
15
+ if HAVE_RCOV
16
+ desc 'Run rcov on the unit tests'
17
+ task :rcov => :clobber_rcov do
18
+ opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
19
+ opts = opts.join(' ')
20
+ files = if test(?f, PROJ.test.file) then [PROJ.test.file]
21
+ else PROJ.test.files end
22
+ files = files.join(' ')
23
+ sh "#{RCOV} #{files} #{opts}"
24
+ end
25
+
26
+ task :clobber_rcov do
27
+ rm_r 'coverage' rescue nil
28
+ end
29
+ end
30
+
31
+ end # namespace :test
32
+
33
+ desc 'Alias to test:run'
34
+ task :test => 'test:run'
35
+
36
+ task :clobber => 'test:clobber_rcov' if HAVE_RCOV
37
+
38
+ end
39
+
40
+ # EOF
@@ -0,0 +1,36 @@
1
+ if HAVE_ZENTEST
2
+
3
+ # --------------------------------------------------------------------------
4
+ if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
5
+ require 'autotest'
6
+
7
+ namespace :test do
8
+ task :autotest do
9
+ Autotest.run
10
+ end
11
+ end
12
+
13
+ desc "Run the autotest loop"
14
+ task :autotest => 'test:autotest'
15
+
16
+ end # if test
17
+
18
+ # --------------------------------------------------------------------------
19
+ if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
20
+ require 'autotest/rspec'
21
+
22
+ namespace :spec do
23
+ task :autotest do
24
+ load '.autotest' if test(?f, '.autotest')
25
+ Autotest::Rspec.run
26
+ end
27
+ end
28
+
29
+ desc "Run the autotest loop"
30
+ task :autotest => 'spec:autotest'
31
+
32
+ end # if rspec
33
+
34
+ end # if HAVE_ZENTEST
35
+
36
+ # EOF
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roart
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 9
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 8
9
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
10
11
  platform: ruby
11
12
  authors:
12
13
  - PJ Davis
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-17 00:00:00 -05:00
18
+ date: 2010-09-15 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: mechanize
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 23
27
30
  segments:
28
31
  - 1
29
32
  - 0
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: bones
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 25
41
46
  segments:
42
47
  - 2
43
48
  - 5
@@ -67,10 +72,7 @@ files:
67
72
  - lib/roart/connection.rb
68
73
  - lib/roart/connection_adapter.rb
69
74
  - lib/roart/connection_adapters/mechanize_adapter.rb
70
- - lib/roart/core/array.rb
71
75
  - lib/roart/core/hash.rb
72
- - lib/roart/core/hash/indifferent_access.rb
73
- - lib/roart/core/string.rb
74
76
  - lib/roart/errors.rb
75
77
  - lib/roart/history.rb
76
78
  - lib/roart/roart.rb
@@ -81,9 +83,7 @@ files:
81
83
  - spec/roart/callbacks_spec.rb
82
84
  - spec/roart/connection_adapter_spec.rb
83
85
  - spec/roart/connection_spec.rb
84
- - spec/roart/core/array_spec.rb
85
86
  - spec/roart/core/hash_spec.rb
86
- - spec/roart/core/string_spec.rb
87
87
  - spec/roart/history_spec.rb
88
88
  - spec/roart/roart_spec.rb
89
89
  - spec/roart/ticket_page_spec.rb
@@ -95,6 +95,19 @@ files:
95
95
  - spec/test_data/search_ticket.txt
96
96
  - spec/test_data/single_history.txt
97
97
  - spec/test_data/ticket.txt
98
+ - tasks/ann.rake
99
+ - tasks/bones.rake
100
+ - tasks/gem.rake
101
+ - tasks/git.rake
102
+ - tasks/notes.rake
103
+ - tasks/post_load.rake
104
+ - tasks/rdoc.rake
105
+ - tasks/rubyforge.rake
106
+ - tasks/setup.rb
107
+ - tasks/spec.rake
108
+ - tasks/svn.rake
109
+ - tasks/test.rake
110
+ - tasks/zentest.rake
98
111
  has_rdoc: true
99
112
  homepage: http://github.com/pjdavis/roart
100
113
  licenses: []
@@ -106,23 +119,27 @@ rdoc_options:
106
119
  require_paths:
107
120
  - lib
108
121
  required_ruby_version: !ruby/object:Gem::Requirement
122
+ none: false
109
123
  requirements:
110
124
  - - ">="
111
125
  - !ruby/object:Gem::Version
126
+ hash: 3
112
127
  segments:
113
128
  - 0
114
129
  version: "0"
115
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
+ none: false
116
132
  requirements:
117
133
  - - ">="
118
134
  - !ruby/object:Gem::Version
135
+ hash: 3
119
136
  segments:
120
137
  - 0
121
138
  version: "0"
122
139
  requirements: []
123
140
 
124
141
  rubyforge_project: roart
125
- rubygems_version: 1.3.6
142
+ rubygems_version: 1.3.7
126
143
  signing_key:
127
144
  specification_version: 3
128
145
  summary: Interface for working with Request Tracker (RT) tickets inspired by ActiveRecord
@@ -1,11 +0,0 @@
1
- class Array
2
-
3
- def to_hash
4
- h = HashWithIndifferentAccess.new
5
- self.each do |element|
6
- h.update(element => nil)
7
- end
8
- h
9
- end
10
-
11
- end
@@ -1,133 +0,0 @@
1
- # used from ActiveSupport
2
- # Copyright (c) 2005-2009 David Heinemeier Hansson
3
-
4
- # This class has dubious semantics and we only have it so that
5
- # people can write params[:key] instead of params['key']
6
- # and they get the same value for both keys.
7
-
8
- class HashWithIndifferentAccess < Hash
9
- def initialize(constructor = {})
10
- if constructor.is_a?(Hash)
11
- super()
12
- update(constructor)
13
- else
14
- super(constructor)
15
- end
16
- end
17
-
18
- def default(key = nil)
19
- if key.is_a?(Symbol) && include?(key = key.to_s)
20
- self[key]
21
- else
22
- super
23
- end
24
- end
25
-
26
- alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
27
- alias_method :regular_update, :update unless method_defined?(:regular_update)
28
-
29
- # Assigns a new value to the hash:
30
- #
31
- # hash = HashWithIndifferentAccess.new
32
- # hash[:key] = "value"
33
- #
34
- def []=(key, value)
35
- regular_writer(convert_key(key), convert_value(value))
36
- end
37
-
38
- # Updates the instantized hash with values from the second:
39
- #
40
- # hash_1 = HashWithIndifferentAccess.new
41
- # hash_1[:key] = "value"
42
- #
43
- # hash_2 = HashWithIndifferentAccess.new
44
- # hash_2[:key] = "New Value!"
45
- #
46
- # hash_1.update(hash_2) # => {"key"=>"New Value!"}
47
- #
48
- def update(other_hash)
49
- other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
50
- self
51
- end
52
-
53
- alias_method :merge!, :update
54
-
55
- # Checks the hash for a key matching the argument passed in:
56
- #
57
- # hash = HashWithIndifferentAccess.new
58
- # hash["key"] = "value"
59
- # hash.key? :key # => true
60
- # hash.key? "key" # => true
61
- #
62
- def key?(key)
63
- super(convert_key(key))
64
- end
65
-
66
- alias_method :include?, :key?
67
- alias_method :has_key?, :key?
68
- alias_method :member?, :key?
69
-
70
- # Fetches the value for the specified key, same as doing hash[key]
71
- def fetch(key, *extras)
72
- super(convert_key(key), *extras)
73
- end
74
-
75
- # Returns an array of the values at the specified indices:
76
- #
77
- # hash = HashWithIndifferentAccess.new
78
- # hash[:a] = "x"
79
- # hash[:b] = "y"
80
- # hash.values_at("a", "b") # => ["x", "y"]
81
- #
82
- def values_at(*indices)
83
- indices.collect {|key| self[convert_key(key)]}
84
- end
85
-
86
- # Returns an exact copy of the hash.
87
- def dup
88
- HashWithIndifferentAccess.new(self)
89
- end
90
-
91
- # Merges the instantized and the specified hashes together, giving precedence to the values from the second hash
92
- # Does not overwrite the existing hash.
93
- def merge(hash)
94
- self.dup.update(hash)
95
- end
96
-
97
- # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
98
- # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a HashWithDifferentAccess.
99
- def reverse_merge(other_hash)
100
- super other_hash.with_indifferent_access
101
- end
102
-
103
- # Removes a specified key from the hash.
104
- def delete(key)
105
- super(convert_key(key))
106
- end
107
-
108
- def stringify_keys!; self end
109
- def symbolize_keys!; self end
110
- def to_options!; self end
111
-
112
- # Convert to a Hash with String keys.
113
- def to_hash
114
- Hash.new(default).merge(self)
115
- end
116
-
117
- protected
118
- def convert_key(key)
119
- key.kind_of?(Symbol) ? key.to_s : key
120
- end
121
-
122
- def convert_value(value)
123
- case value
124
- when Hash
125
- value.with_indifferent_access
126
- when Array
127
- value.collect { |e| e.is_a?(Hash) ? e.with_indifferent_access : e }
128
- else
129
- value
130
- end
131
- end
132
- end
133
-
@@ -1,26 +0,0 @@
1
- # used from ActiveSupport
2
- # Copyright (c) 2005-2009 David Heinemeier Hansson
3
-
4
- class String
5
-
6
- def underscore
7
- self.gsub(/::/, '/').
8
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
9
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
10
- tr("-", "_").
11
- downcase
12
- end
13
-
14
- def camelize
15
- self.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
16
- end
17
-
18
- def humanize
19
- self.gsub(/_id$/, "").gsub(/_/, " ").capitalize
20
- end
21
-
22
- def blank?
23
- self == ""
24
- end
25
-
26
- end