molflow 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92a75eaa0070232b2771a138c034cbad7db572ce
4
- data.tar.gz: e7b7bdba6b5684965f0f5d28c51df5a18e002bd1
3
+ metadata.gz: 024824229e47e4e91fc550d35c4efa2775793c51
4
+ data.tar.gz: daf165eb1d5651c462875131fea58269186fe6eb
5
5
  SHA512:
6
- metadata.gz: 653335f5f67454512689bf7fc81720e99209a75f68a164cb00f7331acef74c3276b325408aca79265bac4e52adf116de5a7d797b01eeac051f2f8a8cd4579fcd
7
- data.tar.gz: 9c5f23aafc10488b5785e31e20ec8d4c313f83c01e0f1cb8aa7b60eb37260fe256c19174b93739c8ba95df04d39aa18075327be9ce055e7db25c06ee364af6ee
6
+ metadata.gz: 9f293fecb8687a18023f5e8d846e3544b26ba33d11a8fad4056754579461e3362fa34bdc5bfa11542d6d586ada4ff03a954a32bd587591a430e0f0287724de90
7
+ data.tar.gz: dd35c9cc641b5d85f2ab26b171b83c31e83c68b511ed7d193f171316e621c6b6d52a1caed19dbf112f225f058b25143cc0a39abd96d5755201e40a2a70d4c109
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
  gem 'molflow', path: '../molflow'
7
7
  gem 'pry'
8
8
  gem 'rest-client'
9
+ gem 'launchy'
9
10
 
10
11
  group :test do
11
12
  gem 'generator_spec'
data/README.md CHANGED
@@ -27,6 +27,9 @@
27
27
  mf jira i ISSUE_KEY # show issue
28
28
  mf jira is # list issues
29
29
  mf jira ps # list projects
30
+ mf open i ISSUE_KEY # open issue in browser; Checked before open browser
31
+ mf open pr PROJECT # open project in browser; Checked before open browser
32
+ mf open j JIRA_KEY # open jira site. skip check api request
30
33
 
31
34
  ## Планы
32
35
 
@@ -2,11 +2,13 @@ require 'thor'
2
2
  require 'pry'
3
3
  require 'molflow/command_options'
4
4
  require 'molflow/commands/jira'
5
+ require 'molflow/commands/open'
5
6
 
6
7
  module Molflow
7
8
  class CLI < Thor
8
9
  extend CommandOptions
9
10
  register(Commands::Jira, 'jira', 'jira <resource>', 'show info jira resource')
11
+ register(Commands::Open, 'open', 'open <resource>', 'open resource in browser')
10
12
 
11
13
  # molflow install
12
14
  method_option 'path', install_options('path')
@@ -15,5 +17,6 @@ module Molflow
15
17
  require 'molflow/commands/install'
16
18
  Commands::Install.start
17
19
  end
20
+
18
21
  end
19
22
  end
@@ -51,5 +51,31 @@ module Molflow
51
51
  }
52
52
  end
53
53
  end
54
+
55
+ def open_options(key)
56
+ case key
57
+ when 'issue_key'
58
+ {
59
+ type: :string,
60
+ aliases: [''],
61
+ default: '',
62
+ desc: 'order issues'
63
+ }
64
+ when 'project_key'
65
+ {
66
+ type: :string,
67
+ aliases: [''],
68
+ default: '',
69
+ desc: 'order issues'
70
+ }
71
+ when 'jira_key'
72
+ {
73
+ type: :string,
74
+ aliases: [''],
75
+ default: '',
76
+ desc: 'order issues'
77
+ }
78
+ end
79
+ end
54
80
  end
55
81
  end
@@ -0,0 +1,50 @@
1
+ require 'molflow/error'
2
+ require 'molflow/commands/jira/client'
3
+ require 'molflow/command_options'
4
+ require 'launchy'
5
+ require 'thor'
6
+
7
+ module Molflow
8
+ module Commands
9
+ class Open < Thor
10
+ include Thor::Actions
11
+ extend Jira::Client
12
+ extend CommandOptions
13
+
14
+ desc 'open p PROJECT_KEY', 'open project in browser'
15
+ def pr(project_key)
16
+ options.merge! project_key: project_key
17
+
18
+ client = Jira.client
19
+ project = client.Project.find(options[:project_key])
20
+
21
+ Launchy.open URI("#{client.options[:site]}/browse/#{project.key}").to_s
22
+ rescue
23
+ puts 'Not found'
24
+ end
25
+
26
+ desc 'open i ISSUE_KEY', 'open issue in browser'
27
+ def i(issue_key)
28
+ options.merge! issue_key: issue_key
29
+
30
+ client = Jira.client
31
+ issue = client.Issue.find(options[:issue_key])
32
+
33
+ Launchy.open URI("#{client.options[:site]}/browse/#{issue.key}").to_s
34
+ rescue
35
+ puts 'Not found'
36
+ end
37
+
38
+ desc 'open any JIRA element. skip api request', 'open browse page in jira'
39
+ def j(jira_key)
40
+ options.merge! jira_key: jira_key
41
+
42
+ client = Jira.client
43
+ Launchy.open URI("#{client.options[:site]}/browse/#{options[:jira_key]}").to_s
44
+ rescue
45
+ puts 'ERROR!'
46
+ end
47
+
48
+ end
49
+ end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Molflow
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: molflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Silaev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -96,6 +96,7 @@ files:
96
96
  - lib/molflow/commands/jira/issue.rb
97
97
  - lib/molflow/commands/jira/issues.rb
98
98
  - lib/molflow/commands/jira/projects.rb
99
+ - lib/molflow/commands/open.rb
99
100
  - lib/molflow/commands/task.rb
100
101
  - lib/molflow/error.rb
101
102
  - lib/molflow/version.rb