mosespa 0.0.5 → 1.0.0

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: 1b81ac92922b7e0881b174c66e97c3731f6bc002
4
- data.tar.gz: a3d4423d2f87291b9609820d16a9067a55872f60
3
+ metadata.gz: 008e221c7a61e38ddc2785cf27c89cb291853e05
4
+ data.tar.gz: 412ffb6715ba599ac00001e27d11a96f30fd103b
5
5
  SHA512:
6
- metadata.gz: fa9ad78a2d2f6b0194b88391f7c48551442a0d345dfbca02be0bcf9368ed3e91cbe13d46659519b0b01f58bf1f223a67e9cebf928fb637ba316186f18937d969
7
- data.tar.gz: f401234fbdeee2809357af61719269dba6251ea4071ddf4bc625f12e8b7912824b2434dc459ec692a3bf8304f8704313333c4936cdf241cfced8aa362994cc21
6
+ metadata.gz: c2092446bfd349e95068f4557986e5b0b1a9b11be4effaca9b546e94e8fca88d021926b1168f433aa3239a814f5a4b7fa277ac144d5df8700d79460184f07768
7
+ data.tar.gz: 88d0d96bf8e71e20919b33b1256683fed090707eed8e270025d5826c6e482ff43058c2d92ed3bcb9ee64b9cb3d48c003034beeb1f1e116165edfb591ce2811b5
data/README.md CHANGED
@@ -9,6 +9,7 @@ Basic command includes :
9
9
  - ```comment TICKET a free text comment```
10
10
  - ```create PROJECT```
11
11
  - ```browse TICKET```
12
+ - ```search a jql research```
12
13
 
13
14
  Usage
14
15
  --------
@@ -51,10 +52,22 @@ If you don't specify the summary option (```mosespa create COOK```), mosespa wil
51
52
  If mosespa did not help you, you can launch your $BROWSER on a ticket page with:
52
53
  ```mosespa browse COOK-2878```
53
54
 
55
+ ###Search
56
+
57
+ To search for any jql:
58
+
59
+ ```mosespa search 'reporter in (currentUser())'```
60
+
54
61
  Installation
55
62
  ------------
56
63
 
64
+ ##### From rubygem.org
65
+ gem install mosespa
66
+
67
+
68
+ #### From source
57
69
  Clone this repository, ```gem build mosespa.gemspec``` and ```gem install mosespa*gem```
58
70
 
71
+ NB:
59
72
  If you want (very) basic bash completion (on sub commands only for now), you can include completion_mosespa file in your .bashrc.
60
73
  Contributions are welcomed on that too !
data/bin/mosespa CHANGED
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  default_config = '~/.mosespa'
13
13
 
14
- SUB_COMMANDS = %w(show comment create browse)
14
+ SUB_COMMANDS = %w(show comment create browse search)
15
15
  global_opts = Trollop::options do
16
16
  banner '"Oh, my bones are aching."'
17
17
  banner "play with jira on command line"
@@ -41,6 +41,9 @@ cmd_opts =
41
41
  opt :summary, "The title of the new ticket", :short => '-s', :type => String
42
42
  opt :description, "The description the new ticket", :short => '-d', :type => String
43
43
  end
44
+ when "search"
45
+ search_str = ([main_arg] + ARGV).join(" ")
46
+ Trollop::options do end
44
47
  when "browse"
45
48
  Trollop::options do
46
49
  opt :verbose, "Output more information"
@@ -67,8 +70,11 @@ options = {
67
70
 
68
71
 
69
72
  client = JIRA::Client.new(options)
73
+
74
+ $stderr.puts "Main argument is #{main_arg}" if global_opts[:debug]
70
75
  case main_arg
71
76
  when /[[:alpha:]]+-[[:digit:]]+/ #ticket
77
+ $stderr.puts "Using ticket mode" if global_opts[:debug]
72
78
  begin
73
79
  issue = main_arg
74
80
  id = client.Issue.jql("key = #{issue}").first.id
@@ -77,7 +83,8 @@ when /[[:alpha:]]+-[[:digit:]]+/ #ticket
77
83
  $stderr.puts e.inspect if global_opts[:debug]
78
84
  abort("Invalid issue? (use --debug to have more information)")
79
85
  end
80
- when /[[:alpha:]]+/ #project
86
+ when /[[:alpha:]]+$/ #project
87
+ $stderr.puts "Using project mode" if global_opts[:debug]
81
88
  begin
82
89
  project_id = main_arg
83
90
  project = client.Project.find(project_id)
@@ -85,6 +92,13 @@ when /[[:alpha:]]+/ #project
85
92
  $stderr.puts e.inspect if global_opts[:debug]
86
93
  abort("Invalid project?(use --debug to have more information")
87
94
  end
95
+ else # only search normally
96
+ begin
97
+ tickets = client.Issue.jql(search_str)
98
+ rescue JIRA::HTTPError => e
99
+ $stderr.puts e.inspect if global_opts[:debug]
100
+ abort("No result for this search ?")
101
+ end
88
102
  end
89
103
 
90
104
 
@@ -99,4 +113,6 @@ when 'create'
99
113
  m.create(client, project, cmd_opts[:summary], cmd_opts[:description])
100
114
  when 'browse'
101
115
  m.browse((options[:site] + '/browse/'+ticket.key))
116
+ when 'search'
117
+ m.search(tickets, global_opts[:debug], cmd_opts[:verbose])
102
118
  end
data/lib/mosespa.rb CHANGED
@@ -28,6 +28,10 @@ module Mosespa
28
28
  c.save({'body' => comment})
29
29
  end
30
30
 
31
+ def search(tickets, json, verbose)
32
+ tickets.each { |t| show(t, json, verbose) }
33
+ end
34
+
31
35
  def create(client, project, summary, description)
32
36
  file = Tempfile.new('mosespa')
33
37
  need_external_editor = summary.nil?
data/mosespa.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mosespa"
6
- s.version = '0.0.5'
6
+ s.version = '1.0.0'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Grégoire Seux"]
9
9
  s.license = "Apache License v2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mosespa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jira-ruby