retr0h-that 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 retr0h
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,11 @@
1
+ = that
2
+
3
+ A gem which used to read the last update of my blog (http://geminstallthat.wordpress.com).
4
+
5
+ == Usage
6
+
7
+ gem install that (get it...?)
8
+
9
+ == Copyright
10
+
11
+ Copyright (c) 2009 John Dewey <john@dewey.ws>. See LICENSE for details.
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :patch: 0
3
+ :major: 0
4
+ :minor: 0
@@ -0,0 +1,2 @@
1
+ ---
2
+ 0.0.0: 2009-04-03 00:25:22 -07:00
data/bin/that ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'that'
4
+
5
+ ##
6
+ # Grab most recent posts since gem was last built.
7
+ That.recent
data/lib/that.rb ADDED
@@ -0,0 +1,48 @@
1
+ require 'simple-rss'
2
+ require 'open-uri'
3
+
4
+ module That
5
+ extend self
6
+
7
+ BLOG_URL = 'http://geminstallthat.wordpress.com/feed/'
8
+ GEM_PATH = File.join(*File.expand_path(__FILE__).split(File::Separator)[0..-3])
9
+ FEED = SimpleRSS.parse(open(BLOG_URL))
10
+
11
+ require 'date'
12
+ def recent
13
+ FEED.items.each do |f|
14
+ if f[:pubDate] >= (YAML.load_file(version_to_pubdate_filename)[current_version])
15
+ puts "#" * 30
16
+ puts f[:pubDate]
17
+ puts f[:description]
18
+ end
19
+ end
20
+ end
21
+
22
+ def build
23
+ version_to_pubdate_mapping
24
+ end
25
+
26
+ private
27
+
28
+ def version_string
29
+ y = YAML.load_file(version_filename)
30
+ "#{y[:minor]}.#{y[:patch]}.#{y[:major]}"
31
+ end
32
+ alias :current_version :version_string
33
+
34
+ def version_filename
35
+ File.join(That::GEM_PATH, 'VERSION.yml')
36
+ end
37
+
38
+ def version_to_pubdate_mapping
39
+ File.open(version_to_pubdate_filename, 'w+') do |f|
40
+ hash = {version_string => FEED.items.first[:pubDate]}
41
+ YAML.dump(hash, f)
42
+ end
43
+ end
44
+
45
+ def version_to_pubdate_filename
46
+ File.join(That::GEM_PATH, 'VERSION_to_PUBDATE.yml')
47
+ end
48
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ require 'that'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
data/spec/that_spec.rb ADDED
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "That" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: retr0h-that
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - retr0h
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-11 00:00:00 -07:00
13
+ default_executable: that
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: simple-rss
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description:
36
+ email: john@dewey.ws
37
+ executables:
38
+ - that
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.rdoc
43
+ - LICENSE
44
+ files:
45
+ - README.rdoc
46
+ - VERSION.yml
47
+ - VERSION_to_PUBDATE.yml
48
+ - bin/that
49
+ - lib/that.rb
50
+ - spec/spec_helper.rb
51
+ - spec/that_spec.rb
52
+ - LICENSE
53
+ has_rdoc: true
54
+ homepage: http://github.com/retr0h/that
55
+ post_install_message:
56
+ rdoc_options:
57
+ - --inline-source
58
+ - --charset=UTF-8
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ requirements: []
74
+
75
+ rubyforge_project:
76
+ rubygems_version: 1.2.0
77
+ signing_key:
78
+ specification_version: 2
79
+ summary: A gem which used to read the last update of my blog.
80
+ test_files: []
81
+