pivotcli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ == 1.0.0 / 2011-04-19
2
+
3
+ * 1 major enhancement
4
+ * Birthday!
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ pivotcli
2
+ ===========
3
+
4
+ CLI for Pivotal Tracker
5
+
6
+
7
+ Examples
8
+ --------
9
+
10
+ `pivotcli -s started -p your_project -o 'Your Name' -t 'token' `
11
+
12
+ Requirements
13
+ ------------
14
+
15
+ * pivotal_tracker
16
+ * colored
17
+
18
+ Install
19
+ -------
20
+
21
+ * gem install pivotcli
22
+
23
+ Author
24
+ ------
25
+
26
+ Original author: Julius F
27
+
28
+
29
+ License
30
+ -------
31
+
32
+ The MIT License
33
+
34
+ Copyright (c) Julius F
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining
37
+ a copy of this software and associated documentation files (the
38
+ 'Software'), to deal in the Software without restriction, including
39
+ without limitation the rights to use, copy, modify, merge, publish,
40
+ distribute, sublicense, and/or sell copies of the Software, and to
41
+ permit persons to whom the Software is furnished to do so, subject to
42
+ the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be
45
+ included in all copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
48
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
50
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
51
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
52
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
53
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+
2
+ begin
3
+ require 'bones'
4
+ rescue LoadError
5
+ abort '### Please install the "bones" gem ###'
6
+ end
7
+
8
+ task :default => 'test:run'
9
+ task 'gem:release' => 'test:run'
10
+
11
+ Bones {
12
+ name 'pivotcli'
13
+ authors 'Julius F'
14
+ email 'baldrailers@gmail.com'
15
+ url 'http://julius.weekendhack.in'
16
+ }
17
+
data/bin/pivotcli ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(
4
+ File.join(File.dirname(__FILE__), %w[.. lib pivotcli]))
5
+ require "choice"
6
+
7
+ PRlGRAM_VERSION = 1
8
+
9
+ Choice.options do
10
+ header ''
11
+ header 'Specific options:'
12
+
13
+ option :project do
14
+ short '-p'
15
+ long '--project=PROJECT'
16
+ desc 'The Project Name'
17
+ default 'Your Project Name'
18
+ end
19
+
20
+ option :owner do
21
+ short '-o'
22
+ long '--owner=OWNER'
23
+ desc 'The owner of the story'
24
+ default 'Story Owner'
25
+ end
26
+
27
+ option :state do
28
+ short '-s'
29
+ long '--state=STATE'
30
+ desc 'State of the stories (started, unstarted, finished, delivered, accepted)'
31
+ default 'unstarted'
32
+ end
33
+
34
+ option :token do
35
+ short '-t'
36
+ long '--token=TOKEN'
37
+ desc 'Token from Pivotal Tracker'
38
+ end
39
+
40
+ separator ''
41
+ separator 'Common options: '
42
+
43
+ option :help do
44
+ long '--help'
45
+ desc 'Show this message'
46
+ end
47
+
48
+ option :version do
49
+ short '-v'
50
+ long '--version'
51
+ desc 'Show version'
52
+ end
53
+ end
54
+
55
+ runner = Runner.new(:project => Choice.choices[:project],
56
+ :owner => Choice.choices[:owner],
57
+ :token => Choice.choices[:token],
58
+ :state => Choice.choices[:state])
59
+
60
+ runner.get_stories
@@ -0,0 +1,33 @@
1
+ require "rubygems"
2
+ require "pivotal_tracker"
3
+ require "colored"
4
+ require "yaml"
5
+
6
+ class Runner
7
+ def initialize(options)
8
+ @project_name = options[:project]
9
+ @owner = options[:owner]
10
+ @state = options[:state]
11
+ @token = options[:token]
12
+
13
+ @pt_client = PivotalTracker::Client.token = @token
14
+
15
+ @projects = PivotalTracker::Project.all
16
+
17
+ @projects.each do |prj|
18
+ if prj.name.downcase.eql? @project_name.downcase
19
+ @prj_id = prj.id
20
+ end
21
+ end
22
+
23
+ @project = PivotalTracker::Project.find(@prj_id)
24
+
25
+ end
26
+
27
+ def get_stories
28
+ @project.stories.all(:current_state => @state, :owned_by => @owner).each do |story|
29
+ puts "#{story.id.to_s.red} | #{story.name}"
30
+ end
31
+ end
32
+
33
+ end
data/lib/pivotcli.rb ADDED
@@ -0,0 +1,60 @@
1
+
2
+ module Pivotcli
3
+
4
+ # :stopdoc:
5
+ LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
6
+ PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
7
+ VERSION = ::File.read(PATH + 'version.txt').strip
8
+ # :startdoc:
9
+
10
+ # Returns the library path for the module. If any arguments are given,
11
+ # they will be joined to the end of the libray path using
12
+ # <tt>File.join</tt>.
13
+ #
14
+ def self.libpath( *args )
15
+ rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
16
+ if block_given?
17
+ begin
18
+ $LOAD_PATH.unshift LIBPATH
19
+ rv = yield
20
+ ensure
21
+ $LOAD_PATH.shift
22
+ end
23
+ end
24
+ return rv
25
+ end
26
+
27
+ # Returns the lpath for the module. If any arguments are given,
28
+ # they will be joined to the end of the path using
29
+ # <tt>File.join</tt>.
30
+ #
31
+ def self.path( *args )
32
+ rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
33
+ if block_given?
34
+ begin
35
+ $LOAD_PATH.unshift PATH
36
+ rv = yield
37
+ ensure
38
+ $LOAD_PATH.shift
39
+ end
40
+ end
41
+ return rv
42
+ end
43
+
44
+ # Utility method used to require all files ending in .rb that lie in the
45
+ # directory below this file that has the same name as the filename passed
46
+ # in. Optionally, a specific _directory_ name can be passed in such that
47
+ # the _filename_ does not have to be equivalent to the directory.
48
+ #
49
+ def self.require_all_libs_relative_to( fname, dir = nil )
50
+ dir ||= ::File.basename(fname, '.*')
51
+ search_me = ::File.expand_path(
52
+ ::File.join(::File.dirname(fname), dir, '**', '*.rb'))
53
+
54
+ Dir.glob(search_me).sort.each {|rb| require rb}
55
+ end
56
+
57
+ end # module Pivotcli
58
+
59
+ Pivotcli.require_all_libs_relative_to(__FILE__)
60
+
data/pivotcli.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{pivotcli}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Julius F"]
9
+ s.date = %q{2011-04-19}
10
+ s.default_executable = %q{pivotcli}
11
+ s.description = %q{CLI for Pivotal Tracker}
12
+ s.email = %q{baldrailers@gmail.com}
13
+ s.executables = ["pivotcli"]
14
+ s.extra_rdoc_files = ["History.txt", "bin/pivotcli"]
15
+ s.files = ["History.txt", "README.md", "Rakefile", "bin/pivotcli", "lib/pivotcli.rb", "lib/pivotcli/runner.rb", "spec/pivotcli_spec.rb", "spec/spec_helper.rb", "test/test_pivotcli.rb", "version.txt"]
16
+ s.homepage = %q{http://julius.weekendhack.in}
17
+ s.rdoc_options = ["--main", "README.md"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{pivotcli}
20
+ s.rubygems_version = %q{1.6.2}
21
+ s.summary = %q{CLI for Pivotal Tracker}
22
+ s.test_files = ["test/test_pivotcli.rb"]
23
+
24
+ if s.respond_to? :specification_version then
25
+ s.specification_version = 3
26
+
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
+ s.add_development_dependency(%q<bones>, [">= 3.6.5"])
29
+ else
30
+ s.add_dependency(%q<bones>, [">= 3.6.5"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<bones>, [">= 3.6.5"])
34
+ end
35
+ end
@@ -0,0 +1,7 @@
1
+
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+
4
+ describe Pivotcli do
5
+
6
+ end
7
+
@@ -0,0 +1,15 @@
1
+
2
+ require File.expand_path(
3
+ File.join(File.dirname(__FILE__), %w[.. lib pivotcli]))
4
+
5
+ Spec::Runner.configure do |config|
6
+ # == Mock Framework
7
+ #
8
+ # RSpec uses it's own mocking framework by default. If you prefer to
9
+ # use mocha, flexmock or RR, uncomment the appropriate line:
10
+ #
11
+ # config.mock_with :mocha
12
+ # config.mock_with :flexmock
13
+ # config.mock_with :rr
14
+ end
15
+
File without changes
data/version.txt ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pivotcli
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Julius F
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-04-19 00:00:00 +08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: bones
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 21
30
+ segments:
31
+ - 3
32
+ - 6
33
+ - 5
34
+ version: 3.6.5
35
+ type: :development
36
+ version_requirements: *id001
37
+ description: CLI for Pivotal Tracker
38
+ email: baldrailers@gmail.com
39
+ executables:
40
+ - pivotcli
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - History.txt
45
+ - bin/pivotcli
46
+ files:
47
+ - History.txt
48
+ - README.md
49
+ - Rakefile
50
+ - bin/pivotcli
51
+ - lib/pivotcli.rb
52
+ - lib/pivotcli/runner.rb
53
+ - pivotcli.gemspec
54
+ - spec/pivotcli_spec.rb
55
+ - spec/spec_helper.rb
56
+ - test/test_pivotcli.rb
57
+ - version.txt
58
+ has_rdoc: true
59
+ homepage: http://julius.weekendhack.in
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --main
65
+ - README.md
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
76
+ version: "0"
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ requirements: []
87
+
88
+ rubyforge_project: pivotcli
89
+ rubygems_version: 1.6.2
90
+ signing_key:
91
+ specification_version: 3
92
+ summary: CLI for Pivotal Tracker
93
+ test_files:
94
+ - test/test_pivotcli.rb