senju 0.3.5 → 0.3.6

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
  SHA256:
3
- metadata.gz: bc49b90adbca31b1b5abd87f73e36b7f102a17bbb0604019abfbac29c6fb43f3
4
- data.tar.gz: 78acead080465e4a637bbb8bd249c872499a50b0f54e35e56704819fea273cbf
3
+ metadata.gz: b2c61b3069b6be1900b39531219ddf8a4324c7dca50dd8e1ab793481be7f8b23
4
+ data.tar.gz: 7fd263fcd1964f526b29a83e2cc6756f381832de4064db594784068da46dd073
5
5
  SHA512:
6
- metadata.gz: 4f2f7906d336c0a6918cda5b66611da23a4955f8239440299776f1d100ea5c3653e6091b18d0140f8271568e2e3ab0ada68000be54ca07252f606f17c05ae998
7
- data.tar.gz: 24fd3b009b5ef2ac38c3bb28f231d2500cd9583d42f1ab79939d45d3c450bb5a5c17cbdf2fed1c38ca36e6593fac8e50bae3d7cfe6bc59955769a666fc48ba8d
6
+ metadata.gz: b646ff7efefc62f3c065203ccd0fbe6009b9adc1895276879afa53e7de103bb972029a0c872c2bc92a68c871c3abdc549c467422b527a06947e6b9164ef0a36f
7
+ data.tar.gz: 2674eb4504449f90c874dadae1deead6a87bc038b180ee697dfc231b07306969714108c5a3265969dc207a4743d6fd4e1065d8db85fdb0905d86d6da195269f1
@@ -4,6 +4,7 @@ require "tty-markdown"
4
4
  require "rumoji"
5
5
  require "senju/diff"
6
6
  require "senju/init"
7
+ require "senju/track"
7
8
 
8
9
  COLORS = %w{green blue light_blue}
9
10
 
@@ -88,6 +89,18 @@ if ARGV[0] == "init"
88
89
  Senju.init
89
90
  elsif ARGV[0] == "add"
90
91
  Senju::Projects.add_interactive(ARGV[1])
92
+ elsif ARGV[0] == "track" or ARGV[0] == "t"
93
+ Senju::Track.add(ARGV[1], ARGV[2])
94
+ print "Track issue successfly.\n".colorize(:green)
95
+
96
+ elsif ARGV[0] == "tracks"
97
+ Senju::Track.all.each do |project, issues|
98
+ repo = Senju::Repository.find(project)
99
+ issues.each do |issue, data|
100
+ exec(repo, issue, "-v")
101
+ end
102
+ end
103
+
91
104
  elsif repo
92
105
  exec(Senju::Repository.find(repo), command, option)
93
106
  else
@@ -18,8 +18,8 @@ class Senju::Projects
18
18
  self.load
19
19
  end
20
20
 
21
- def self.[](conf)
22
- data[conf]
21
+ def self.[](name)
22
+ data[name] || raise("Unknown project \"#{name}\".")
23
23
  end
24
24
 
25
25
  def self.[]=(name, table)
@@ -0,0 +1,27 @@
1
+ require 'yaml'
2
+ class Senju::Track
3
+ PATH = Dir.home + '/.senju/tracks'
4
+
5
+ def self.load
6
+ if File.exist? PATH
7
+ @data = YAML.load_file(PATH)
8
+ else
9
+ @data = {}
10
+ end
11
+ end
12
+
13
+ def self.save
14
+ YAML.dump(@data, File.open(PATH, 'w'))
15
+ end
16
+
17
+ def self.all
18
+ self.load
19
+ end
20
+
21
+ def self.add(project, issue_no)
22
+ load
23
+ @data[project] = {} unless @data[project]
24
+ @data[project][issue_no.to_i] = nil
25
+ save
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Senju
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: senju
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira SUENAMI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -179,6 +179,7 @@ files:
179
179
  - lib/senju/issue.rb
180
180
  - lib/senju/projects.rb
181
181
  - lib/senju/repository.rb
182
+ - lib/senju/track.rb
182
183
  - lib/senju/trello.rb
183
184
  - lib/senju/version.rb
184
185
  - senju.gemspec
@@ -202,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
203
  version: '0'
203
204
  requirements: []
204
205
  rubyforge_project:
205
- rubygems_version: 2.7.7
206
+ rubygems_version: 2.7.6
206
207
  signing_key:
207
208
  specification_version: 4
208
209
  summary: Transparent wrapper of some task management and collabolation tools.