active_pivot 0.1.2 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbfc5897f77a4dbc082654bd6a59efe4b73884df
4
- data.tar.gz: 82d5e7bc8a57af20bc9fd132afa0742518deb82b
3
+ metadata.gz: 3b13e1cd493e4f285668a90231455489197e0b09
4
+ data.tar.gz: 7be9173bf2c3d08c3d9672f1d5778305edc1fdbd
5
5
  SHA512:
6
- metadata.gz: c56e3a372e75981d4f848e931c8ec42744bd8a8b1905b1c4a359ecebf244a324650240bcc8a5f572c355f69785154b14df400640cbdb13aafcc7b7d1a565f6f4
7
- data.tar.gz: 8700abd39e31864dafbd59288764c709a2482e2ca6f074c16627927c66d5db7e93df267dfc3f23056984c64cee204ea5137cb5f36945e9547df90785d3025c8a
6
+ metadata.gz: 184fec0e13df0bb48cb330e8ca4bd744d7b1c7182cc663570c31ef8abea9197e819055b6953f0a307e098cf63a57b9afb20cc00eef3c41323ec0e1afdd3203b0
7
+ data.tar.gz: 46b42db10bc22ec66c6cd13647aa48f76aa40c5a683ad08eb74519a969a8e6818289c9b9dd835f63981e4b55072981513c53a6358edb41f70b8b7738fd73229f
data/README.md CHANGED
@@ -42,6 +42,10 @@ Add your Pivotal Tracker API token to your secrets.yml:
42
42
 
43
43
  `tracker_api_token: <%= ENV["PIVOTAL_TRACKER_API_TOKEN"] %>`
44
44
 
45
+ If you would like to use the import rake tasks, add this line to your project's Rakefile:
46
+
47
+ `require 'active_pivot/import_tasks'`
48
+
45
49
  Now you can import your projects and stories using the following:
46
50
 
47
51
  `rake active_pivot:import:pivotal_initial` for all activity up to 3 years ago
data/lib/active_pivot.rb CHANGED
@@ -21,4 +21,3 @@ require "active_pivot/activity"
21
21
 
22
22
  require "rake"
23
23
  require "active_pivot/railtie" if defined?(Rails)
24
- load "tasks/import.rake"
@@ -0,0 +1,36 @@
1
+ module ActivePivot
2
+ class ImportTasks
3
+ include Rake::DSL if defined? Rake::DSL
4
+
5
+ def import_tasks
6
+ namespace :active_pivot do
7
+ namespace :import do
8
+ task :pivotal_update, [:interval] => :environment do |t, args|
9
+ updated_after = args[:interval].to_i.minutes.ago
10
+ puts "Updating since #{updated_after}"
11
+ ActivePivot::Importer.run(updated_after)
12
+ end
13
+
14
+ task pivotal_initial: :environment do
15
+ interval = 3.years.ago
16
+ ActivePivot::Importer.run(interval)
17
+ end
18
+
19
+ task :pivotal_date, [:interval] => :environment do |t, args|
20
+ begin
21
+ updated_after = DateTime.parse args[:interval]
22
+ puts "Updating since #{updated_after}"
23
+ ActivePivot::Importer.run(updated_after)
24
+ rescue
25
+ puts "Could not parse your start date"
26
+ puts "Enter a date such as 'August 12, 2015'"
27
+ puts "Example: rake active_import:import:pivotal_date['August 12, 2015']"
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ ActivePivot::ImportTasks.new.import_tasks
@@ -1,9 +1,7 @@
1
1
  require 'active_pivot'
2
2
  require 'rails'
3
+
3
4
  module ActivePivot
4
5
  class Railtie < Rails::Railtie
5
- rake_tasks do
6
- load 'lib/tasks/import.rake'
7
- end
8
6
  end
9
7
  end
@@ -1,3 +1,3 @@
1
1
  module ActivePivot
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_pivot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allan McLelland
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-08-31 00:00:00.000000000 Z
12
+ date: 2015-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -114,6 +114,7 @@ files:
114
114
  - lib/active_pivot/api/story.rb
115
115
  - lib/active_pivot/epic.rb
116
116
  - lib/active_pivot/epic_story.rb
117
+ - lib/active_pivot/import_tasks.rb
117
118
  - lib/active_pivot/importer.rb
118
119
  - lib/active_pivot/pivotal.rb
119
120
  - lib/active_pivot/project.rb
@@ -121,7 +122,6 @@ files:
121
122
  - lib/active_pivot/story.rb
122
123
  - lib/active_pivot/version.rb
123
124
  - lib/generators/active_pivot/migrations_generator.rb
124
- - lib/tasks/import.rake
125
125
  homepage: https://github.com/foraker/active_pivot
126
126
  licenses:
127
127
  - MIT
@@ -1,27 +0,0 @@
1
- namespace :active_pivot do
2
- namespace :import do
3
-
4
- task :pivotal_update, [:interval] => :environment do |t, args|
5
- updated_after = args[:interval].to_i.minutes.ago
6
- puts "Updating since #{updated_after}"
7
- ActivePivot::Importer.run(updated_after)
8
- end
9
-
10
- task pivotal_initial: :environment do
11
- interval = 3.years.ago
12
- ActivePivot::Importer.run(interval)
13
- end
14
-
15
- task :pivotal_date, [:interval] => :environment do |t, args|
16
- begin
17
- updated_after = DateTime.parse args[:interval]
18
- puts "Updating since #{updated_after}"
19
- ActivePivot::Importer.run(updated_after)
20
- rescue
21
- puts "Could not parse your start date"
22
- puts "Enter a date such as 'August 12, 2015'"
23
- puts "Example: rake active_import:import:pivotal_date['August 12, 2015']"
24
- end
25
- end
26
- end
27
- end