caperoma 0.1.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -0
  3. data/Capefile +48 -0
  4. data/Capefile.template +48 -0
  5. data/Capefile.test +20 -0
  6. data/Gemfile +25 -10
  7. data/Gemfile.lock +196 -77
  8. data/HELP +321 -0
  9. data/README.md +528 -0
  10. data/Rakefile +73 -18
  11. data/VERSION +1 -1
  12. data/bin/caperoma +47 -11
  13. data/caperoma.gemspec +144 -45
  14. data/config/crontab +10 -0
  15. data/config/schedule.rb +21 -0
  16. data/lib/caperoma.rb +409 -9
  17. data/lib/caperoma/models/account.rb +47 -0
  18. data/lib/caperoma/models/application_record.rb +5 -0
  19. data/lib/caperoma/models/branch.rb +6 -0
  20. data/lib/caperoma/models/project.rb +14 -0
  21. data/lib/caperoma/models/property.rb +5 -0
  22. data/lib/caperoma/models/report.rb +177 -0
  23. data/lib/caperoma/models/report_recipient.rb +6 -0
  24. data/lib/caperoma/models/reports/daily_report.rb +23 -0
  25. data/lib/caperoma/models/reports/retrospective_report.rb +19 -0
  26. data/lib/caperoma/models/reports/three_day_report.rb +19 -0
  27. data/lib/caperoma/models/task.rb +368 -0
  28. data/lib/caperoma/models/tasks/bug.rb +36 -0
  29. data/lib/caperoma/models/tasks/chore.rb +40 -0
  30. data/lib/caperoma/models/tasks/feature.rb +27 -0
  31. data/lib/caperoma/models/tasks/fix.rb +56 -0
  32. data/lib/caperoma/models/tasks/meeting.rb +40 -0
  33. data/lib/caperoma/models/tasks/modules/git.rb +65 -0
  34. data/lib/caperoma/models/tasks/task_with_commit.rb +40 -0
  35. data/lib/caperoma/models/tasks/task_with_separate_branch.rb +42 -0
  36. data/lib/caperoma/services/airbrake_email_processor.rb +47 -0
  37. data/lib/caperoma/services/pivotal_fetcher.rb +108 -0
  38. data/lib/caperoma/version.rb +9 -0
  39. data/spec/caperoma_spec.rb +3 -21
  40. data/spec/factories/accounts.rb +10 -0
  41. data/spec/factories/branches.rb +9 -0
  42. data/spec/factories/projects.rb +8 -0
  43. data/spec/factories/report_recipients.rb +7 -0
  44. data/spec/factories/reports.rb +16 -0
  45. data/spec/factories/tasks.rb +37 -0
  46. data/spec/features/bug_spec.rb +60 -0
  47. data/spec/features/chore_spec.rb +60 -0
  48. data/spec/features/command_unknown_spec.rb +14 -0
  49. data/spec/features/config_spec.rb +161 -0
  50. data/spec/features/feature_spec.rb +60 -0
  51. data/spec/features/finish_spec.rb +18 -0
  52. data/spec/features/fix_spec.rb +60 -0
  53. data/spec/features/meeting_spec.rb +22 -0
  54. data/spec/features/projects_spec.rb +17 -0
  55. data/spec/features/report_recipientss_spec.rb +117 -0
  56. data/spec/features/reports_spec.rb +65 -0
  57. data/spec/features/status_spec.rb +33 -0
  58. data/spec/features/version_spec.rb +11 -0
  59. data/spec/models/account_spec.rb +51 -0
  60. data/spec/models/branch_spec.rb +8 -0
  61. data/spec/models/bug_spec.rb +33 -0
  62. data/spec/models/chore_spec.rb +33 -0
  63. data/spec/models/daily_report_spec.rb +38 -0
  64. data/spec/models/feature_spec.rb +33 -0
  65. data/spec/models/fix_spec.rb +55 -0
  66. data/spec/models/meeting_spec.rb +33 -0
  67. data/spec/models/project_spec.rb +11 -0
  68. data/spec/models/report_recipient_spec.rb +22 -0
  69. data/spec/models/report_spec.rb +16 -0
  70. data/spec/models/retrospective_report_spec.rb +38 -0
  71. data/spec/models/task_spec.rb +613 -0
  72. data/spec/models/task_with_commit_spec.rb +105 -0
  73. data/spec/models/task_with_separate_branch_spec.rb +97 -0
  74. data/spec/models/three_day_report_spec.rb +49 -0
  75. data/spec/spec_helper.rb +26 -16
  76. data/spec/support/capefile_generator.rb +36 -0
  77. data/spec/support/database_cleaner.rb +21 -0
  78. data/spec/support/stubs.rb +178 -9
  79. metadata +283 -42
  80. data/.document +0 -5
  81. data/README.rdoc +0 -26
  82. data/lib/caperoma/credentials.rb +0 -13
  83. data/lib/caperoma/jira_client.rb +0 -57
  84. data/spec/caperoma/credentials_spec.rb +0 -25
  85. data/spec/caperoma/jira_spec.rb +0 -35
@@ -1,13 +0,0 @@
1
- class Credentials
2
- def self.write(args)
3
- db = SDBM.open 'jira_credentials'
4
-
5
- db.store('email', args[2])
6
- db.store('password', args[3])
7
- end
8
-
9
- def self.read
10
- db = SDBM.open 'jira_credentials'
11
- db.to_hash
12
- end
13
- end
@@ -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
@@ -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