mingle4r 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ 0.4.1
2
+ -----
3
+ * Added execute mql api. Now you can make arbitrary MQL queries and get their result.
4
+
1
5
  0.4.0
2
6
  -----
3
7
 
data/README CHANGED
@@ -222,6 +222,17 @@ defect_card.execute_transition(
222
222
  if the transition requires to be set manually, multiple properties might need to be set.
223
223
  )
224
224
 
225
+ N) MQL execution
226
+ ----------------
227
+
228
+ mingle allows you to write an arbitrary MQL query and returns the results. This gem
229
+ allows you to do that in a simpler way. If you want to know more about MQL go to http://www.thoughtworks-studios.com/mingle/3.0/help/mql_reference.html.
230
+
231
+ m_c = Mingle4r::MingleClient.new('http://localhost:8080', 'testuser', 'password')
232
+ m_c.proj_id = 'great_mingle_project'
233
+ m_c.project.execute_mql('SELECT name, "Added in Iteration" WHERE Type = Story')
234
+ => returns an array of hash
235
+
225
236
  == REQUIREMENTS:
226
237
 
227
238
  1) active_resource gem, it would be automatically taken care of
data/TODO.txt CHANGED
@@ -1,7 +1,6 @@
1
1
  update documentation - write about executing transitions directly on the transition
2
2
  write tests for project class
3
3
 
4
-
5
4
  refactorings
6
5
  ------------
7
6
 
@@ -0,0 +1,15 @@
1
+ module Mingle4r
2
+ module API
3
+ class ExecuteMql
4
+ extend Mingle4r::CommonClassMethods
5
+
6
+ def self.query(query_string)
7
+ @resource_class.find(:all, :params => {:mql => query_string}).
8
+ collect { |res| res.attributes }
9
+ end
10
+ end
11
+ end
12
+ end
13
+
14
+ Mingle4r::API::ExecuteMql.collection_name = 'execute_mql'
15
+ Mingle4r::API::ExecuteMql.element_name = 'result'
@@ -49,9 +49,16 @@ module Mingle4r
49
49
  murmur.save
50
50
  end
51
51
 
52
+ # executes an mql
53
+ def execute_mql(query)
54
+ set_attributes_for(ExecuteMql)
55
+ ExecuteMql.query(query)
56
+ end
57
+
52
58
  private
53
59
  def set_attributes_for(klass)
54
60
  resource_site = File.join(self.class.site.to_s, "projects/#{self.identifier}")
61
+ resource_site = File.join(resource_site, 'cards') if klass == ExecuteMql
55
62
  klass.site = resource_site
56
63
  klass.user = self.class.user
57
64
  klass.password = self.class.password
@@ -2,7 +2,7 @@ module Mingle4r
2
2
  module Version
3
3
  Major = '0'
4
4
  Minor = '4'
5
- Tiny = '0'
5
+ Tiny = '1'
6
6
 
7
7
  def self.to_s
8
8
  Major + '.' + Minor + '.' + Tiny
data/lib/mingle4r.rb CHANGED
@@ -20,6 +20,7 @@ require 'mingle4r/api/card'
20
20
  require 'mingle4r/api/card/attachment'
21
21
  require 'mingle4r/api/card/comment'
22
22
  require 'mingle4r/api/card/transition'
23
+ require 'mingle4r/api/execute_mql'
23
24
  require 'mingle4r/api/murmur'
24
25
  require 'mingle4r/api/project'
25
26
  require 'mingle4r/api/property_definition'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mingle4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - asur
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-02 00:00:00 +05:30
12
+ date: 2010-02-11 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ files:
41
41
  - lib/mingle4r/api/card/attachment.rb
42
42
  - lib/mingle4r/api/card/comment.rb
43
43
  - lib/mingle4r/api/card/transition.rb
44
+ - lib/mingle4r/api/execute_mql.rb
44
45
  - lib/mingle4r/api/murmur.rb
45
46
  - lib/mingle4r/api/project.rb
46
47
  - lib/mingle4r/api/property_definition.rb