caperoma 0.1.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -0
- data/Capefile +48 -0
- data/Capefile.template +48 -0
- data/Capefile.test +20 -0
- data/Gemfile +25 -10
- data/Gemfile.lock +196 -77
- data/HELP +321 -0
- data/README.md +528 -0
- data/Rakefile +73 -18
- data/VERSION +1 -1
- data/bin/caperoma +47 -11
- data/caperoma.gemspec +144 -45
- data/config/crontab +10 -0
- data/config/schedule.rb +21 -0
- data/lib/caperoma.rb +409 -9
- data/lib/caperoma/models/account.rb +47 -0
- data/lib/caperoma/models/application_record.rb +5 -0
- data/lib/caperoma/models/branch.rb +6 -0
- data/lib/caperoma/models/project.rb +14 -0
- data/lib/caperoma/models/property.rb +5 -0
- data/lib/caperoma/models/report.rb +177 -0
- data/lib/caperoma/models/report_recipient.rb +6 -0
- data/lib/caperoma/models/reports/daily_report.rb +23 -0
- data/lib/caperoma/models/reports/retrospective_report.rb +19 -0
- data/lib/caperoma/models/reports/three_day_report.rb +19 -0
- data/lib/caperoma/models/task.rb +368 -0
- data/lib/caperoma/models/tasks/bug.rb +36 -0
- data/lib/caperoma/models/tasks/chore.rb +40 -0
- data/lib/caperoma/models/tasks/feature.rb +27 -0
- data/lib/caperoma/models/tasks/fix.rb +56 -0
- data/lib/caperoma/models/tasks/meeting.rb +40 -0
- data/lib/caperoma/models/tasks/modules/git.rb +65 -0
- data/lib/caperoma/models/tasks/task_with_commit.rb +40 -0
- data/lib/caperoma/models/tasks/task_with_separate_branch.rb +42 -0
- data/lib/caperoma/services/airbrake_email_processor.rb +47 -0
- data/lib/caperoma/services/pivotal_fetcher.rb +108 -0
- data/lib/caperoma/version.rb +9 -0
- data/spec/caperoma_spec.rb +3 -21
- data/spec/factories/accounts.rb +10 -0
- data/spec/factories/branches.rb +9 -0
- data/spec/factories/projects.rb +8 -0
- data/spec/factories/report_recipients.rb +7 -0
- data/spec/factories/reports.rb +16 -0
- data/spec/factories/tasks.rb +37 -0
- data/spec/features/bug_spec.rb +60 -0
- data/spec/features/chore_spec.rb +60 -0
- data/spec/features/command_unknown_spec.rb +14 -0
- data/spec/features/config_spec.rb +161 -0
- data/spec/features/feature_spec.rb +60 -0
- data/spec/features/finish_spec.rb +18 -0
- data/spec/features/fix_spec.rb +60 -0
- data/spec/features/meeting_spec.rb +22 -0
- data/spec/features/projects_spec.rb +17 -0
- data/spec/features/report_recipientss_spec.rb +117 -0
- data/spec/features/reports_spec.rb +65 -0
- data/spec/features/status_spec.rb +33 -0
- data/spec/features/version_spec.rb +11 -0
- data/spec/models/account_spec.rb +51 -0
- data/spec/models/branch_spec.rb +8 -0
- data/spec/models/bug_spec.rb +33 -0
- data/spec/models/chore_spec.rb +33 -0
- data/spec/models/daily_report_spec.rb +38 -0
- data/spec/models/feature_spec.rb +33 -0
- data/spec/models/fix_spec.rb +55 -0
- data/spec/models/meeting_spec.rb +33 -0
- data/spec/models/project_spec.rb +11 -0
- data/spec/models/report_recipient_spec.rb +22 -0
- data/spec/models/report_spec.rb +16 -0
- data/spec/models/retrospective_report_spec.rb +38 -0
- data/spec/models/task_spec.rb +613 -0
- data/spec/models/task_with_commit_spec.rb +105 -0
- data/spec/models/task_with_separate_branch_spec.rb +97 -0
- data/spec/models/three_day_report_spec.rb +49 -0
- data/spec/spec_helper.rb +26 -16
- data/spec/support/capefile_generator.rb +36 -0
- data/spec/support/database_cleaner.rb +21 -0
- data/spec/support/stubs.rb +178 -9
- metadata +283 -42
- data/.document +0 -5
- data/README.rdoc +0 -26
- data/lib/caperoma/credentials.rb +0 -13
- data/lib/caperoma/jira_client.rb +0 -57
- data/spec/caperoma/credentials_spec.rb +0 -25
- data/spec/caperoma/jira_spec.rb +0 -35
data/lib/caperoma/credentials.rb
DELETED
data/lib/caperoma/jira_client.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'jira'
|
2
|
-
|
3
|
-
class JiraClient
|
4
|
-
def initialize
|
5
|
-
@client ||= JIRA::Client.new(credentials)
|
6
|
-
end
|
7
|
-
|
8
|
-
def create_chore(args)
|
9
|
-
# issue = client.Issue.build
|
10
|
-
# params = chore_params(args[1], args[2])
|
11
|
-
# issue.save(params)
|
12
|
-
# issue.fetch
|
13
|
-
# issue.fields['key'] # =>"RUC-1037"
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
def client(email, password)
|
18
|
-
JIRA::Client.new(sign_in_params)
|
19
|
-
end
|
20
|
-
|
21
|
-
def project
|
22
|
-
@client.Project.all.find{|proj| proj.name =~ /Ruck.us/ }
|
23
|
-
end
|
24
|
-
|
25
|
-
def chore_params(message, time_spent)
|
26
|
-
{
|
27
|
-
"update" => {
|
28
|
-
"worklog" => [{
|
29
|
-
"add" => {
|
30
|
-
"started" => "2011-07-05T11:05:00.000+0000",
|
31
|
-
"timeSpent" => "62m"
|
32
|
-
}
|
33
|
-
}]
|
34
|
-
},
|
35
|
-
"fields" => {
|
36
|
-
"summary"=>"test message",
|
37
|
-
"description"=>"test description",
|
38
|
-
"project"=> { "id" => "#{project.id}" },
|
39
|
-
"issuetype" => { "id"=>"9" }
|
40
|
-
}
|
41
|
-
# and it should close the issue too
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
def credentials
|
46
|
-
credentials = Credentials.read
|
47
|
-
|
48
|
-
{
|
49
|
-
username: credentials[:email],
|
50
|
-
password: credentials[:password],
|
51
|
-
site: 'https://cubuss.atlassian.net/',
|
52
|
-
context_path: '',
|
53
|
-
auth_type: :basic,
|
54
|
-
use_ssl: true
|
55
|
-
}
|
56
|
-
end
|
57
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'Caperoma::Credentials', :expect_db_write do
|
4
|
-
specify '#write' do
|
5
|
-
expect_any_instance_of(SDBM).to receive(:store).with('email', 'email@example.com')
|
6
|
-
expect_any_instance_of(SDBM).to receive(:store).with('password', 'secret123')
|
7
|
-
|
8
|
-
Credentials.write(['config', '--jira', 'email@example.com', 'secret123'])
|
9
|
-
end
|
10
|
-
|
11
|
-
describe '#read' do
|
12
|
-
context 'data present' do
|
13
|
-
let(:expected_result) { { email: 'email@example.com', password: 'secret123' } }
|
14
|
-
|
15
|
-
it 'should output credentials hash' do
|
16
|
-
expect_any_instance_of(SDBM).to receive(:to_hash).and_return expected_result
|
17
|
-
|
18
|
-
expect(Credentials.read).to eq expected_result
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
context 'data is not present', :pending do
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/spec/caperoma/jira_spec.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'JiraClient' do
|
4
|
-
describe 'initialize' do
|
5
|
-
let!(:credentials) do
|
6
|
-
{
|
7
|
-
username: 'test@example.com',
|
8
|
-
password: 'secret123',
|
9
|
-
site: 'https://cubuss.atlassian.net/',
|
10
|
-
context_path: '',
|
11
|
-
auth_type: :basic,
|
12
|
-
use_ssl: true
|
13
|
-
}
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should sign in' do
|
17
|
-
expected_credentials = { email: 'test@example.com', password: 'secret123' }
|
18
|
-
allow(Credentials).to receive(:read).and_return expected_credentials
|
19
|
-
expect(JIRA::Client).to receive(:new).with(credentials)
|
20
|
-
|
21
|
-
JiraClient.new
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#find_project' do
|
26
|
-
it 'should find project Ruck.us' do
|
27
|
-
# expect_any_instance_of(JIRA::Client).to receive_message_chain(:Project, :all).and_return JIRA::Project.build
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe '#chore' do
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|