molflow 0.1.6 → 0.2.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 +4 -4
- data/Gemfile +6 -2
- data/bin/molflow +2 -3
- data/lib/molflow.rb +1 -0
- data/lib/molflow/cli.rb +38 -0
- data/lib/molflow/cli/install.rb +30 -0
- data/lib/molflow/cli/install/molflow +3 -0
- data/lib/molflow/cli/jira_issues.rb +20 -0
- data/lib/molflow/cli/jira_projects.rb +18 -0
- data/lib/molflow/cli/task.rb +15 -0
- data/lib/molflow/jira.rb +22 -1
- data/lib/molflow/version.rb +1 -1
- data/molflow.gemspec +4 -1
- data/spec/spec_helper.rb +4 -2
- metadata +39 -18
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/lib/molflow/application.rb +0 -18
- data/lib/molflow/install.rb +0 -1
- data/lib/molflow/tasks/install.rake +0 -43
- data/lib/molflow/tasks/jira.rake +0 -40
- data/lib/molflow/templates/molflow.erb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3051535820c9d5ee3f7c8456b0fea1ffc361b399
|
4
|
+
data.tar.gz: f8530e2828227be2784d4e893292dd58753de3fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf78541e7af95b9f4502600a7e35dff57dc26bee2cf7f0c02c76430d0426054a59b3b8ecd0b11b87cbc0e171286f6095f50d065e96a03502d544cd0a45e53c4a
|
7
|
+
data.tar.gz: db9b0483d061613ef308cc4ab2a840c2f0a5dd0f7523fe3949d43b09ec4735a311649a0e971fe8d5021ba96fcc9eb8a9ba34a206954fff0ad0a65fcc8d476b4f
|
data/Gemfile
CHANGED
data/bin/molflow
CHANGED
data/lib/molflow.rb
CHANGED
data/lib/molflow/cli.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'pry'
|
3
|
+
|
4
|
+
module Molflow
|
5
|
+
class CLI < Thor
|
6
|
+
# molflow install
|
7
|
+
|
8
|
+
desc 'install', 'Install Figaro'
|
9
|
+
|
10
|
+
method_option 'path',
|
11
|
+
aliases: ['-p'],
|
12
|
+
default: "#{ENV['HOME']}/.molflow",
|
13
|
+
desc: 'Specify a configuration file path'
|
14
|
+
|
15
|
+
def install
|
16
|
+
require 'molflow/cli/install'
|
17
|
+
Install.start
|
18
|
+
end
|
19
|
+
|
20
|
+
# molflow jira:ps
|
21
|
+
|
22
|
+
desc 'jira:ps', 'The list of projects in jira'
|
23
|
+
|
24
|
+
define_method 'jira:ps' do
|
25
|
+
require 'molflow/cli/jira_projects'
|
26
|
+
JiraProjects.run(options)
|
27
|
+
end
|
28
|
+
|
29
|
+
# molflow jira:is
|
30
|
+
|
31
|
+
desc 'jira:is', 'The list of projects in jira'
|
32
|
+
|
33
|
+
define_method 'jira:is' do
|
34
|
+
require 'molflow/cli/jira_issues'
|
35
|
+
JiraIssues.run(options)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Molflow
|
4
|
+
class CLI < Thor
|
5
|
+
class Install < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
class_option 'path',
|
9
|
+
aliases: ['-p'],
|
10
|
+
default: "#{ENV['HOME']}/.molflow",
|
11
|
+
desc: 'Specify a configuration file path'
|
12
|
+
|
13
|
+
def self.source_root
|
14
|
+
File.expand_path('../install', __FILE__)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_configuration
|
18
|
+
@site = ask('Atlassian site: ')
|
19
|
+
@username = ask('Atlassian username: ')
|
20
|
+
@password = ask('Atlassian password: ')
|
21
|
+
|
22
|
+
template('molflow', options[:path])
|
23
|
+
end
|
24
|
+
|
25
|
+
def complete
|
26
|
+
say('COMPLETE!', :green)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'molflow/jira'
|
2
|
+
require 'molflow/cli/task'
|
3
|
+
|
4
|
+
module Molflow
|
5
|
+
class CLI < Thor
|
6
|
+
class JiraIssues < Task
|
7
|
+
|
8
|
+
def run
|
9
|
+
client = Jira.client
|
10
|
+
jql = 'assignee = currentUser() AND (status = "To Do" OR status = "In Progress") AND (labels not in (Приостановлен) OR labels is EMPTY) ORDER BY updatedDate DESC'
|
11
|
+
|
12
|
+
issues = client.Issue.jql(jql)
|
13
|
+
|
14
|
+
issues.each do |issue|
|
15
|
+
puts "#{issue.key} : #{issue.summary}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "molflow/jira"
|
2
|
+
require "molflow/cli/task"
|
3
|
+
|
4
|
+
module Molflow
|
5
|
+
class CLI < Thor
|
6
|
+
class JiraProjects < Task
|
7
|
+
|
8
|
+
def run
|
9
|
+
client = Jira.client
|
10
|
+
@projects = client.Project.all
|
11
|
+
|
12
|
+
@projects.each do |project|
|
13
|
+
puts("#{project.key} : #{project.name}")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/molflow/jira.rb
CHANGED
@@ -1 +1,22 @@
|
|
1
|
-
|
1
|
+
require 'jira'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module Molflow
|
5
|
+
class Jira
|
6
|
+
def self.client
|
7
|
+
config_path = "#{ENV['HOME']}/.molflow"
|
8
|
+
config_of_file = YAML.load_file(config_path)
|
9
|
+
|
10
|
+
options = {
|
11
|
+
username: config_of_file['username'],
|
12
|
+
password: config_of_file['password'],
|
13
|
+
site: config_of_file['site'],
|
14
|
+
auth_type: :basic,
|
15
|
+
context_path: '',
|
16
|
+
use_ssl: true
|
17
|
+
}
|
18
|
+
|
19
|
+
JIRA::Client.new(options)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/molflow/version.rb
CHANGED
data/molflow.gemspec
CHANGED
@@ -14,9 +14,12 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.files = `git ls-files`.split($/)
|
15
15
|
|
16
16
|
s.required_ruby_version = '>= 1.9.3'
|
17
|
-
s.
|
17
|
+
s.add_dependency "thor", "~> 0.14"
|
18
18
|
s.add_dependency 'jira-ruby','~> 0.1'
|
19
19
|
|
20
|
+
s.add_development_dependency "bundler", "~> 1.7"
|
21
|
+
s.add_development_dependency "rake", "~> 10.4"
|
22
|
+
|
20
23
|
s.executables = %w(molflow)
|
21
24
|
s.require_paths = ["lib"]
|
22
25
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: molflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 10.0.0
|
19
|
+
version: '0.14'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 10.0.0
|
26
|
+
version: '0.14'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: jira-ruby
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,6 +38,34 @@ dependencies:
|
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
40
|
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.4'
|
47
69
|
description: Workflow in Molinos
|
48
70
|
email:
|
49
71
|
- dmsilaev@yandex.ru
|
@@ -59,17 +81,16 @@ files:
|
|
59
81
|
- LICENSE.txt
|
60
82
|
- README.md
|
61
83
|
- Rakefile
|
62
|
-
- bin/console
|
63
84
|
- bin/molflow
|
64
|
-
- bin/setup
|
65
85
|
- lib/Rakefile
|
66
86
|
- lib/molflow.rb
|
67
|
-
- lib/molflow/
|
68
|
-
- lib/molflow/install.rb
|
87
|
+
- lib/molflow/cli.rb
|
88
|
+
- lib/molflow/cli/install.rb
|
89
|
+
- lib/molflow/cli/install/molflow
|
90
|
+
- lib/molflow/cli/jira_issues.rb
|
91
|
+
- lib/molflow/cli/jira_projects.rb
|
92
|
+
- lib/molflow/cli/task.rb
|
69
93
|
- lib/molflow/jira.rb
|
70
|
-
- lib/molflow/tasks/install.rake
|
71
|
-
- lib/molflow/tasks/jira.rake
|
72
|
-
- lib/molflow/templates/molflow.erb
|
73
94
|
- lib/molflow/version.rb
|
74
95
|
- molflow.gemspec
|
75
96
|
- spec/molflow_spec.rb
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "molflow"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/lib/molflow/application.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module Molflow
|
2
|
-
class Application < Rake::Application
|
3
|
-
def initialize
|
4
|
-
super
|
5
|
-
@rakefiles = %w{Capfile} << rakefile
|
6
|
-
end
|
7
|
-
|
8
|
-
def run
|
9
|
-
Rake.application = self
|
10
|
-
super
|
11
|
-
end
|
12
|
-
|
13
|
-
# allows the `cap install` task to load without a capfile
|
14
|
-
def rakefile
|
15
|
-
File.expand_path(File.join(File.dirname(__FILE__),'..','Rakefile'))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/molflow/install.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
load File.expand_path(File.join(File.dirname(__FILE__),'tasks/install.rake'))
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
require 'pathname'
|
3
|
-
|
4
|
-
task :install do
|
5
|
-
home_dir = Pathname.new(ENV['HOME'])
|
6
|
-
molflow = File.expand_path("../../templates/molflow.erb", __FILE__)
|
7
|
-
|
8
|
-
entries = [{ template: molflow, file: home_dir.join('.molflow') }]
|
9
|
-
|
10
|
-
entries.each do |entry|
|
11
|
-
if File.exists?(entry[:file])
|
12
|
-
warn "[skip] #{entry[:file]} already exists"
|
13
|
-
else
|
14
|
-
File.open(entry[:file], 'w+') do |f|
|
15
|
-
f.write(ERB.new(File.read(entry[:template])).result(binding))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def site
|
22
|
-
STDOUT.puts "atlassian site:"
|
23
|
-
input = STDIN.gets.chomp
|
24
|
-
raise "enter address" if input == ''
|
25
|
-
|
26
|
-
input
|
27
|
-
end
|
28
|
-
|
29
|
-
def username
|
30
|
-
STDOUT.puts "atlassian username:"
|
31
|
-
input = STDIN.gets.chomp
|
32
|
-
raise "enter username" if input == ''
|
33
|
-
|
34
|
-
input
|
35
|
-
end
|
36
|
-
|
37
|
-
def password
|
38
|
-
STDOUT.puts "atlassian password:"
|
39
|
-
input = STDIN.gets.chomp
|
40
|
-
raise "enter password" if input == ''
|
41
|
-
|
42
|
-
input
|
43
|
-
end
|
data/lib/molflow/tasks/jira.rake
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'jira'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
namespace :jira do
|
5
|
-
molflow_config_file = Pathname.new(ENV['HOME']).join('.molflow')
|
6
|
-
|
7
|
-
if File.exist?(molflow_config_file)
|
8
|
-
molflow_config = YAML.load_file(molflow_config_file)
|
9
|
-
|
10
|
-
options = {
|
11
|
-
:username => molflow_config['username'],
|
12
|
-
:password => molflow_config['password'],
|
13
|
-
:site => molflow_config['site'],
|
14
|
-
:auth_type => :basic,
|
15
|
-
:context_path => '',
|
16
|
-
:use_ssl => true
|
17
|
-
}
|
18
|
-
|
19
|
-
@client = JIRA::Client.new(options)
|
20
|
-
end
|
21
|
-
|
22
|
-
task :ps do
|
23
|
-
# Show all projects
|
24
|
-
@projects = @client.Project.all
|
25
|
-
@projects.each do |project|
|
26
|
-
puts "#{project.key} : #{project.name}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
task :is do
|
31
|
-
jql = 'assignee = currentUser() AND (status = "To Do" OR status = "In Progress") AND (labels not in (Приостановлен) OR labels is EMPTY) ORDER BY updatedDate DESC'
|
32
|
-
|
33
|
-
@issues = @client.Issue.jql(jql)
|
34
|
-
|
35
|
-
@issues.each do |issue|
|
36
|
-
puts "#{issue.key} : #{issue.summary}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|