sly 0.0.1 → 0.0.3

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.
Files changed (5) hide show
  1. data/bin/sly +6 -35
  2. data/lib/sly/gui.rb +0 -15
  3. data/lib/sly/item.rb +14 -2
  4. data/lib/sly/version.rb +1 -1
  5. metadata +37 -4
data/bin/sly CHANGED
@@ -1,13 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'gli'
3
3
  require 'sly'
4
- begin # XXX: Remove this begin/rescue before distributing your app
5
- rescue LoadError
6
- STDERR.puts "In development, you need to use `bundle exec bin/todo` to run your app"
7
- STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
8
- STDERR.puts "Feel free to remove this message from bin/sly now"
9
- exit 64
10
- end
4
+
5
+ SLY_PROJECT = File.join(".sly", "project")
11
6
 
12
7
  include GLI::App
13
8
 
@@ -40,19 +35,12 @@ command :setup do |c|
40
35
  end
41
36
  end
42
37
 
43
- desc 'shows an overview of the current state of the project from backlog to complete.'
44
- command :dashboard do |c|
45
- c.action do |global_options,options,args|
46
- project = Sly::Project.load(File.join(".sly", "project"))
47
- project.update
48
- Sly::GUI.display_dashboard(project)
49
- end
50
- end
51
-
52
38
  desc 'shows the current backlog for the project.'
53
39
  command :backlog do |c|
40
+ arg_name :mine ,'mine Lists the items in the backlog which are assigned to you'
41
+ arg_name :user, 'USER Lists the items in the backlog which are assigned to USER'
54
42
  c.action do |global_options,options,args|
55
- project = Sly::Project.load(File.join(".sly", "project"))
43
+ project = Sly::Project.load(SLY_PROJECT)
56
44
  project.update
57
45
  Sly::GUI.display_backlog(project)
58
46
  end
@@ -61,21 +49,12 @@ end
61
49
  desc 'shows the current in-progress for the project.'
62
50
  command :current do |c|
63
51
  c.action do |global_options,options,args|
64
- project = Sly::Project.load(File.join(".sly", "project"))
52
+ project = Sly::Project.load(SLY_PROJECT)
65
53
  project.update
66
54
  Sly::GUI.display_current(project)
67
55
  end
68
56
  end
69
57
 
70
- desc 'shows the current completed items for the project.'
71
- command :complete do |c|
72
- c.action do |global_options,options,args|
73
- project = Sly::Project.load(File.join(".sly", "project"))
74
- project.update
75
- Sly::GUI.display_complete(project)
76
- end
77
- end
78
-
79
58
  desc 'Describe new here'
80
59
  arg_name 'Describe arguments to new here'
81
60
  command :new do |c|
@@ -92,14 +71,6 @@ command :move do |c|
92
71
  end
93
72
  end
94
73
 
95
- desc 'Describe comment here'
96
- arg_name 'Describe arguments to comment here'
97
- command :comment do |c|
98
- c.action do |global_options,options,args|
99
- puts "comment command ran"
100
- end
101
- end
102
-
103
74
  pre do |global,command,options,args|
104
75
  # Pre logic here
105
76
  # Return true to proceed; false to abourt and not call the
data/lib/sly/gui.rb CHANGED
@@ -9,17 +9,6 @@ class Sly::GUI
9
9
  end
10
10
  end
11
11
 
12
- def self.display_dashboard(project)
13
- #table_columns = [{Backlog: project.backlog},
14
- # {Current: project.current},
15
- # {Complete: project.complete}]
16
- #table_columns.each do |hash|
17
- # hash.each do |k,v|
18
- # p v.map(&:overview)
19
- # end
20
- #end
21
- end
22
-
23
12
  def self.display_backlog(project)
24
13
  self.display_items("Backlog", project.backlog)
25
14
  end
@@ -28,10 +17,6 @@ class Sly::GUI
28
17
  self.display_items("Current", project.current)
29
18
  end
30
19
 
31
- def self.display_complete(project)
32
- self.display_items("Completed", project.complete)
33
- end
34
-
35
20
  private
36
21
 
37
22
  def self.display_items(title, items)
data/lib/sly/item.rb CHANGED
@@ -1,6 +1,10 @@
1
+ require 'rainbow'
2
+
1
3
  class Sly::Item
2
4
 
3
- attr_accessor :number, :archived, :title, :score, :tags, :status
5
+ TYPE_COLOR = { task: :default, test: :blue, defect: :red, story: :green }
6
+
7
+ attr_accessor :number, :archived, :title, :score, :tags, :status, :type
4
8
 
5
9
  def initialize(item_attributes = {})
6
10
  @number = item_attributes["number"]
@@ -9,10 +13,12 @@ class Sly::Item
9
13
  @score = item_attributes["score"]
10
14
  @tags = item_attributes["tags"]
11
15
  @status = item_attributes["status"]
16
+ @type = item_attributes["type"].to_sym
12
17
  end
13
18
 
14
19
  def overview
15
- self.prettify([@title, @number].join("\n#"), 44)+"\n"
20
+ quick_ref = "##{@number} - ".color(type_colour) + " #{@score} ".background(type_colour).color(:white)
21
+ self.prettify([quick_ref, @title.color(type_colour)].join("\n"), 44)+"\n"
16
22
  end
17
23
 
18
24
  alias_method :to_s, :overview
@@ -25,4 +31,10 @@ class Sly::Item
25
31
  content.scan(/\S.{0,#{wrap_limit}}\S(?=\s|$)|\S+/).join("\n")
26
32
  end
27
33
 
34
+ private
35
+
36
+ def type_colour
37
+ TYPE_COLOR[@type]
38
+ end
39
+
28
40
  end
data/lib/sly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sly
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-27 00:00:00.000000000 Z
12
+ date: 2013-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: webmock
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
62
78
  - !ruby/object:Gem::Dependency
63
79
  name: curb
64
80
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +123,24 @@ dependencies:
107
123
  - - ! '>='
108
124
  - !ruby/object:Gem::Version
109
125
  version: 2.5.0
110
- description:
126
+ - !ruby/object:Gem::Dependency
127
+ name: rainbow
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ description: A small set of tools for working with Sprint.ly without leaving the command
143
+ line.
111
144
  email: robert@terracoding.com
112
145
  executables:
113
146
  - sly
@@ -153,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
186
  version: '0'
154
187
  requirements: []
155
188
  rubyforge_project:
156
- rubygems_version: 1.8.24
189
+ rubygems_version: 1.8.25
157
190
  signing_key:
158
191
  specification_version: 3
159
192
  summary: A small set of tools for working with Sprint.ly without leaving the command