pluto-tasks 1.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fb84bb53573bcc450ab3b5b2224cd05adcc0ad39
4
+ data.tar.gz: 571764b7b5352531055601ed8ccf2cf819104206
5
+ SHA512:
6
+ metadata.gz: 71cecfcfa4fa750a4a1bea97c4d3c74d4b5351e132e6c6e751ddae5c510762680c58b7664f634632f6a30c11520e3d84d752e1e95ed58e58c92c6c15db7d3e6f
7
+ data.tar.gz: 4a5e7123715b423f584a844fda57ddd687ebf0ccbf917975e82877fcecc284bed4767601573175204f98e7292ad2219663023c88e6686a9ae4093b474b53947d
data/HISTORY.md ADDED
@@ -0,0 +1,4 @@
1
+
2
+ ### 0.0.1 / 2014-12-13
3
+
4
+ * Everything is new. First release
data/Manifest.txt ADDED
@@ -0,0 +1,10 @@
1
+ HISTORY.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ lib/pluto/tasks.rb
6
+ lib/pluto/tasks/env.rake
7
+ lib/pluto/tasks/setup.rake
8
+ lib/pluto/tasks/stats.rake
9
+ lib/pluto/tasks/update.rake
10
+ lib/pluto/tasks/version.rb
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # pluto-tasks gem - planet rake tasks (setup, update, stats, etc.)
2
+
3
+ * home :: [github.com/feedreader/pluto-tasks](https://github.com/feedreader/pluto-tasks)
4
+ * bugs :: [github.com/feedreader/pluto-tasks/issues](https://github.com/feedreader/pluto-tasks/issues)
5
+ * gem :: [rubygems.org/gems/pluto-tasks](https://rubygems.org/gems/pluto-tasks)
6
+ * rdoc :: [rubydoc.info/gems/pluto-tasks](http://rubydoc.info/gems/pluto-tasks)
7
+ * forum :: [groups.google.com/group/feedreader](http://groups.google.com/group/feedreader)
8
+
9
+
10
+
11
+ ## Usage
12
+
13
+
14
+
15
+ ## License
16
+
17
+ The `pluto-tasks` scripts are dedicated to the public domain.
18
+ Use it as you please with no restrictions whatsoever.
19
+
20
+ ## Questions? Comments?
21
+
22
+ Send them along to the [Planet Pluto and Friends Forum/Mailing List](http://groups.google.com/group/feedreader).
23
+ Thanks!
24
+
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ require 'hoe'
2
+ require './lib/pluto/tasks/version.rb'
3
+
4
+ Hoe.spec 'pluto-tasks' do
5
+
6
+ self.version = PlutoTasks::VERSION
7
+
8
+ self.summary = "pluto-tasks - planet rake tasks (setup, update, stats, etc.)"
9
+ self.description = summary
10
+
11
+ self.urls = ['https://github.com/feedreader/pluto-tasks']
12
+
13
+ self.author = 'Gerald Bauer'
14
+ self.email = 'feedreader@googlegroups.com'
15
+
16
+ # switch extension to .markdown for gihub formatting
17
+ self.readme_file = 'README.md'
18
+ self.history_file = 'HISTORY.md'
19
+
20
+ self.extra_deps = [
21
+ ['pluto-models', '>= 1.2.2'],
22
+ ['pluto-update'],
23
+ ['pluto-merge'], ## todo/check: add merge - why? why not?
24
+ ]
25
+
26
+ self.licenses = ['Public Domain']
27
+
28
+ self.spec_extras = {
29
+ required_ruby_version: '>= 1.9.2'
30
+ }
31
+
32
+ end
@@ -0,0 +1,25 @@
1
+
2
+
3
+ task :env do
4
+ LogUtils::Logger.root.level = :debug
5
+
6
+ Pluto.connect!
7
+ end
8
+
9
+
10
+ #########
11
+ # for debugging
12
+
13
+ desc 'pluto - debug site setup'
14
+ task :site => :env do
15
+ site = Pluto::Models::Site.first # FIX: for now assume one planet per DB (fix later; allow planet key or similar)
16
+ if site.present?
17
+ puts "site found:"
18
+ pp site
19
+ else
20
+ puts "no site found"
21
+ end
22
+ end
23
+
24
+ ### todo: add new task :sites
25
+
@@ -0,0 +1,40 @@
1
+
2
+
3
+ desc 'pluto -=- setup/update feed subscriptions'
4
+ task :setup => :env do
5
+
6
+ ## check if PLANET key passed in
7
+ if ENV['PLANET'].present?
8
+ key = ENV['PLANET']
9
+ puts "setup planet for key >#{key}<"
10
+ else
11
+ puts 'no PLANET=key passed along; try defaults'
12
+ # try pluto.yml or planet.yml if exist
13
+
14
+ if File.exists?( './pluto.ini' ) || File.exists?( './pluto.yml' ) # check if pluto.yml exists, if yes add/use it
15
+ key ='pluto'
16
+ elsif File.exists?( './planet.ini' ) || File.exists?( './planet.yml' ) # check if planet.yml exists, if yes add/use it
17
+ key = 'planet'
18
+ else
19
+ puts '*** note: no arg passed in; no pluto.ini|yml or planet.ini|yml found in working folder'
20
+ end
21
+ end
22
+
23
+
24
+ config_path = "./#{key}.ini"
25
+ if File.exists?( config_path )
26
+ config = INI.load_file( config_path )
27
+ else ## assume .yml
28
+ config_path = "./#{key}.yml"
29
+ config = YAML.load_file( config_path )
30
+ end
31
+
32
+
33
+ puts "dump planet setup settings >#{config_path}<:"
34
+ pp config
35
+
36
+ # note: allow multiple planets (sites) for a single install
37
+ Pluto::Subscriber.new.update_subscriptions_for( key, config )
38
+
39
+ puts 'Done.'
40
+ end
@@ -0,0 +1,10 @@
1
+
2
+
3
+ desc 'pluto - show planet (feed) stats'
4
+ task :stats => :env do
5
+ puts "stats:"
6
+ puts " Feeds: #{Pluto::Models::Feed.count}"
7
+ puts " Items: #{Pluto::Models::Item.count}"
8
+ puts " Sites: #{Pluto::Models::Site.count}"
9
+ puts " Subscriptions: #{Pluto::Models::Subscription.count}"
10
+ end
@@ -0,0 +1,24 @@
1
+
2
+
3
+ desc 'pluto -=- update planet (site configs)'
4
+ task :update_sites => :env do
5
+
6
+ Pluto.update_sites # update all site configs if source (url) present/specified
7
+
8
+ puts 'Done (Update Sites).'
9
+ end
10
+
11
+
12
+ desc 'pluto -=- update planet (feeds)'
13
+ task :update_feeds => :env do
14
+
15
+ Pluto.update_feeds
16
+
17
+ puts 'Done (Update Feeds).'
18
+ end
19
+
20
+
21
+ desc 'pluto -=- update planet (site configs + feeds)'
22
+ task :update => [:update_sites, :update_feeds] do
23
+ puts 'Done.'
24
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+
3
+ module PlutoTasks
4
+
5
+ MAJOR = 1
6
+ MINOR = 1
7
+ PATCH = 0
8
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
9
+
10
+ def self.version
11
+ VERSION
12
+ end
13
+
14
+ def self.banner
15
+ ### todo: add RUBY_PATCHLEVEL or RUBY_PATCH_LEVEL e.g. -p124
16
+ "pluto-tasks/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
17
+ end
18
+
19
+ def self.root
20
+ "#{File.expand_path( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )}"
21
+ end
22
+
23
+ end # module PlutoTasks
24
+
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ require 'pluto/models'
5
+
6
+ require 'pluto/update'
7
+ require 'pluto/merge' ## todo/check: add merge - really used- why? why not?
8
+
9
+
10
+ # our own code
11
+
12
+ require 'pluto/tasks/version' # note: let version always get first
13
+
14
+
15
+ module Pluto
16
+
17
+ def self.load_tasks
18
+ # load all builtin Rake tasks (from tasks/*rake)
19
+ load 'pluto/tasks/env.rake'
20
+ load 'pluto/tasks/setup.rake'
21
+ load 'pluto/tasks/stats.rake'
22
+ load 'pluto/tasks/update.rake'
23
+ end
24
+
25
+ end # module Pluto
26
+
27
+
28
+
29
+
30
+ # say hello
31
+ puts PlutoTasks.banner if $DEBUG || (defined?($RUBYLIBS_DEBUG) && $RUBYLIBS_DEBUG)
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pluto-tasks
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Bauer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pluto-models
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: pluto-update
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pluto-merge
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rdoc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: hoe
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.13'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.13'
83
+ description: pluto-tasks - planet rake tasks (setup, update, stats, etc.)
84
+ email: feedreader@googlegroups.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files:
88
+ - HISTORY.md
89
+ - Manifest.txt
90
+ - README.md
91
+ files:
92
+ - HISTORY.md
93
+ - Manifest.txt
94
+ - README.md
95
+ - Rakefile
96
+ - lib/pluto/tasks.rb
97
+ - lib/pluto/tasks/env.rake
98
+ - lib/pluto/tasks/setup.rake
99
+ - lib/pluto/tasks/stats.rake
100
+ - lib/pluto/tasks/update.rake
101
+ - lib/pluto/tasks/version.rb
102
+ homepage: https://github.com/feedreader/pluto-tasks
103
+ licenses:
104
+ - Public Domain
105
+ metadata: {}
106
+ post_install_message:
107
+ rdoc_options:
108
+ - "--main"
109
+ - README.md
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.9.2
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubyforge_project:
124
+ rubygems_version: 2.4.2
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: pluto-tasks - planet rake tasks (setup, update, stats, etc.)
128
+ test_files: []