trollolo 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +17 -0
- data/CONTRIBUTING.md +7 -0
- data/COPYING +674 -0
- data/Gemfile +11 -0
- data/README.md +92 -0
- data/Rakefile +12 -0
- data/bin/trollolo +33 -0
- data/lib/burndown_chart.rb +158 -0
- data/lib/burndown_data.rb +172 -0
- data/lib/card.rb +64 -0
- data/lib/cli.rb +251 -0
- data/lib/settings.rb +54 -0
- data/lib/trello.rb +66 -0
- data/lib/trollolo.rb +34 -0
- data/lib/version.rb +5 -0
- data/man/.gitignore +4 -0
- data/man/trollolo.1.md +152 -0
- data/scripts/create_burndown.py +149 -0
- data/spec/burndown_chart_spec.rb +307 -0
- data/spec/burndown_data_spec.rb +125 -0
- data/spec/card_spec.rb +15 -0
- data/spec/cli_spec.rb +18 -0
- data/spec/command_line_spec.rb +56 -0
- data/spec/data/burndown-data.yaml +26 -0
- data/spec/data/burndown_dir/burndown-data-01.yaml +9 -0
- data/spec/data/burndown_dir/burndown-data-02.yaml +9 -0
- data/spec/data/burndown_dir/create_burndown +142 -0
- data/spec/data/cards.json +1002 -0
- data/spec/data/lists.json +50 -0
- data/spec/data/trollolorc +2 -0
- data/spec/settings_spec.rb +39 -0
- data/spec/spec_helper.rb +23 -0
- data/spec/trello_spec.rb +32 -0
- data/spec/wrapper/credentials_input_wrapper +19 -0
- data/spec/wrapper/empty_config_trollolo_wrapper +10 -0
- data/spec/wrapper/trollolo_wrapper +11 -0
- data/trollolo.gemspec +28 -0
- metadata +131 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"pos": 16384,
|
4
|
+
"subscribed": false,
|
5
|
+
"name": "Sprint Backlog",
|
6
|
+
"closed": false,
|
7
|
+
"id": "53186e8391ef8671265eba9e",
|
8
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"pos": 32768,
|
12
|
+
"subscribed": false,
|
13
|
+
"name": "Doing",
|
14
|
+
"closed": false,
|
15
|
+
"id": "53186e8391ef8671265eba9f",
|
16
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"pos": 36864,
|
20
|
+
"subscribed": false,
|
21
|
+
"name": "Done Sprint 10",
|
22
|
+
"closed": false,
|
23
|
+
"id": "5319bf088cdf9cd82be336b0",
|
24
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"pos": 40960,
|
28
|
+
"subscribed": false,
|
29
|
+
"name": "Done Sprint 9",
|
30
|
+
"closed": false,
|
31
|
+
"id": "5319bf045c6ef0092c55331e",
|
32
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"pos": 49152,
|
36
|
+
"subscribed": false,
|
37
|
+
"name": "Done Sprint 8",
|
38
|
+
"closed": false,
|
39
|
+
"id": "53186e8391ef8671265ebaa0",
|
40
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"pos": 114688,
|
44
|
+
"subscribed": false,
|
45
|
+
"name": "Legend",
|
46
|
+
"closed": false,
|
47
|
+
"id": "5319bc0aa338308d42f108d6",
|
48
|
+
"idBoard": "53186e8391ef8671265eba9d"
|
49
|
+
}
|
50
|
+
]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe Settings do
|
4
|
+
|
5
|
+
include GivenFilesystemSpecHelpers
|
6
|
+
|
7
|
+
context "given config file" do
|
8
|
+
before(:each) do
|
9
|
+
@settings = Settings.new( File.expand_path('../data/trollolorc',__FILE__) )
|
10
|
+
end
|
11
|
+
|
12
|
+
it "is not verbose by default" do
|
13
|
+
expect(@settings.verbose).to be false
|
14
|
+
end
|
15
|
+
|
16
|
+
it "reads config file" do
|
17
|
+
expect(@settings.developer_public_key).to eq "mykey"
|
18
|
+
expect(@settings.member_token).to eq "mytoken"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context "non-existent config file" do
|
23
|
+
use_given_filesystem
|
24
|
+
|
25
|
+
before(:each) do
|
26
|
+
@config_file = given_dummy_file
|
27
|
+
@settings = Settings.new(@config_file)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "saves config file" do
|
31
|
+
@settings.developer_public_key = "mypublickey"
|
32
|
+
@settings.member_token = "mymembertoken"
|
33
|
+
@settings.save_config
|
34
|
+
|
35
|
+
expect(File.read(@config_file)).to eq "---\ndeveloper_public_key: mypublickey\nmember_token: mymembertoken\n"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
|
4
|
+
require_relative '../lib/trollolo'
|
5
|
+
|
6
|
+
require 'given_filesystem/spec_helpers'
|
7
|
+
require 'webmock/rspec'
|
8
|
+
|
9
|
+
WebMock.disable_net_connect!(:allow => "codeclimate.com")
|
10
|
+
|
11
|
+
bin_path = File.expand_path( "../../bin/", __FILE__ )
|
12
|
+
|
13
|
+
if ENV['PATH'] !~ /#{bin_path}/
|
14
|
+
ENV['PATH'] = bin_path + File::PATH_SEPARATOR + ENV['PATH']
|
15
|
+
end
|
16
|
+
|
17
|
+
def load_test_file filename
|
18
|
+
File.read(File.expand_path('../data/' + filename,__FILE__))
|
19
|
+
end
|
20
|
+
|
21
|
+
def dummy_settings
|
22
|
+
Settings.new( File.expand_path('../data/trollolorc',__FILE__) )
|
23
|
+
end
|
data/spec/trello_spec.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Trello do
|
4
|
+
|
5
|
+
let(:trello) { Trello.new(board_id: "myboard", developer_public_key: "mykey", member_token: "mytoken") }
|
6
|
+
|
7
|
+
describe "lists" do
|
8
|
+
it "returns a list of cards" do
|
9
|
+
stub_request(:get, "https://trello.com/1/boards/myboard/lists?key=mykey&token=mytoken").
|
10
|
+
to_return(:status => 200, :body => load_test_file('lists.json'))
|
11
|
+
expect(trello.lists).to be_a(Array)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "handles a server returning garbage" do
|
15
|
+
stub_request(:get, "https://trello.com/1/boards/myboard/lists?key=mykey&token=mytoken").
|
16
|
+
to_return(:status => 503, :body => "nginx says no")
|
17
|
+
expect { trello.lists }.to raise_error(Trello::ApiError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "handles a non-200 response" do
|
21
|
+
stub_request(:get, "https://trello.com/1/boards/myboard/lists?key=mykey&token=mytoken").
|
22
|
+
to_return(:status => 404, :body => "{}")
|
23
|
+
expect { trello.lists }.to raise_error(Trello::ApiError)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "handles a non-json response" do
|
27
|
+
stub_request(:get, "https://trello.com/1/boards/myboard/lists?key=mykey&token=mytoken").
|
28
|
+
to_return(:status => 200, :body => "well, garbage.")
|
29
|
+
expect { trello.lists }.to raise_error(Trello::ApiError)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require "expect"
|
4
|
+
require "pty"
|
5
|
+
|
6
|
+
config_path = "/tmp/test-trollolorc-#{rand(100000)}"
|
7
|
+
bin_path = File.expand_path('../../../bin/trollolo',__FILE__)
|
8
|
+
|
9
|
+
ENV["TROLLOLO_CONFIG_PATH"] = config_path
|
10
|
+
|
11
|
+
PTY.spawn("#{bin_path} #{ARGV.join(" ")}") do |trollolo_out,trollolo_in,pid|
|
12
|
+
if !trollolo_out.expect("key:",2)
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
trollolo_in.puts("xxx")
|
16
|
+
if !trollolo_out.expect("token:",2)
|
17
|
+
exit 1
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
test_config_path = File.expand_path('../../data/trollolorc',__FILE__)
|
4
|
+
bin_path = File.expand_path('../../../bin/trollolo',__FILE__)
|
5
|
+
|
6
|
+
ENV["TROLLOLO_CONFIG_PATH"] = test_config_path
|
7
|
+
#cmd = "TROLLOLO_CONFIG_PATH=#{test_config_path} #{bin_path} #{ARGV.join(" ")}"
|
8
|
+
|
9
|
+
cmd = "#{bin_path} #{ARGV.join(" ")}"
|
10
|
+
|
11
|
+
exec(cmd)
|
data/trollolo.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "trollolo"
|
6
|
+
s.version = Trollolo::VERSION
|
7
|
+
s.license = 'GPL-3'
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ['Cornelius Schumacher']
|
10
|
+
s.email = ['cschum@suse.de']
|
11
|
+
s.homepage = "https://github.com/openSUSE/trollolo"
|
12
|
+
s.summary = "Trello command line client"
|
13
|
+
s.description = "Trollolo is a command line tool to access Trello and support tasks like generation of burndown charts."
|
14
|
+
|
15
|
+
s.required_rubygems_version = ">= 1.3.6"
|
16
|
+
s.rubyforge_project = "trollolo"
|
17
|
+
|
18
|
+
s.add_dependency "thor", ">=0.14.0"
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
22
|
+
s.require_path = 'lib'
|
23
|
+
|
24
|
+
s.files += Dir['man/*.?'] # UNIX man pages
|
25
|
+
s.files += Dir['man/*.{html,css,js}'] # HTML man pages
|
26
|
+
s.add_development_dependency 'ronn', '>=0.7.3'
|
27
|
+
s.add_development_dependency 'rake'
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trollolo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cornelius Schumacher
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.14.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.14.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ronn
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.7.3
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.7.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Trollolo is a command line tool to access Trello and support tasks like
|
56
|
+
generation of burndown charts.
|
57
|
+
email:
|
58
|
+
- cschum@suse.de
|
59
|
+
executables:
|
60
|
+
- trollolo
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- .gitignore
|
65
|
+
- .rspec
|
66
|
+
- .travis.yml
|
67
|
+
- CHANGELOG.md
|
68
|
+
- CONTRIBUTING.md
|
69
|
+
- COPYING
|
70
|
+
- Gemfile
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- bin/trollolo
|
74
|
+
- lib/burndown_chart.rb
|
75
|
+
- lib/burndown_data.rb
|
76
|
+
- lib/card.rb
|
77
|
+
- lib/cli.rb
|
78
|
+
- lib/settings.rb
|
79
|
+
- lib/trello.rb
|
80
|
+
- lib/trollolo.rb
|
81
|
+
- lib/version.rb
|
82
|
+
- man/.gitignore
|
83
|
+
- man/trollolo.1.md
|
84
|
+
- scripts/create_burndown.py
|
85
|
+
- spec/burndown_chart_spec.rb
|
86
|
+
- spec/burndown_data_spec.rb
|
87
|
+
- spec/card_spec.rb
|
88
|
+
- spec/cli_spec.rb
|
89
|
+
- spec/command_line_spec.rb
|
90
|
+
- spec/data/burndown-data.yaml
|
91
|
+
- spec/data/burndown_dir/burndown-data-01.yaml
|
92
|
+
- spec/data/burndown_dir/burndown-data-02.yaml
|
93
|
+
- spec/data/burndown_dir/create_burndown
|
94
|
+
- spec/data/cards.json
|
95
|
+
- spec/data/lists.json
|
96
|
+
- spec/data/trollolorc
|
97
|
+
- spec/settings_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
- spec/trello_spec.rb
|
100
|
+
- spec/wrapper/credentials_input_wrapper
|
101
|
+
- spec/wrapper/empty_config_trollolo_wrapper
|
102
|
+
- spec/wrapper/trollolo_wrapper
|
103
|
+
- trollolo.gemspec
|
104
|
+
- man/trollolo.1
|
105
|
+
- man/trollolo.1.html
|
106
|
+
homepage: https://github.com/openSUSE/trollolo
|
107
|
+
licenses:
|
108
|
+
- GPL-3
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 1.3.6
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project: trollolo
|
126
|
+
rubygems_version: 2.0.3
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Trello command line client
|
130
|
+
test_files: []
|
131
|
+
has_rdoc:
|