climagic 1.0.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.
- data/Rakefile +8 -0
- data/bin/climagic +5 -0
- data/lib/climagic.rb +20 -0
- data/test/test_climagic.rb +8 -0
- metadata +66 -0
data/Rakefile
ADDED
data/bin/climagic
ADDED
data/lib/climagic.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/evn ruby
|
|
2
|
+
require 'net/http'
|
|
3
|
+
require 'open-uri'
|
|
4
|
+
require 'nokogiri'
|
|
5
|
+
# The main climagic driver
|
|
6
|
+
class CliMagic
|
|
7
|
+
# Get command of the day from climagic
|
|
8
|
+
#
|
|
9
|
+
# Example:
|
|
10
|
+
# >> CliMagic.cmd()
|
|
11
|
+
# => "while true; do date; printf "\033[A"; sleep 1; done"
|
|
12
|
+
def self.cmd()
|
|
13
|
+
# Gets the command of the day
|
|
14
|
+
cmd_url = 'http://www.climagic.org/'
|
|
15
|
+
cmd_selector = "tt" # Hope this remians ;)
|
|
16
|
+
page = Nokogiri::HTML(open(cmd_url).read)
|
|
17
|
+
page.css(cmd_selector).text
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: climagic
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Hemanth.HM
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-05-20 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: nokogiri
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.5.0
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 1.5.0
|
|
30
|
+
description: A simple gem to get todays command from climagic.org
|
|
31
|
+
email: hemanth.hm@gmail.com
|
|
32
|
+
executables:
|
|
33
|
+
- climagic
|
|
34
|
+
extensions: []
|
|
35
|
+
extra_rdoc_files: []
|
|
36
|
+
files:
|
|
37
|
+
- Rakefile
|
|
38
|
+
- lib/climagic.rb
|
|
39
|
+
- bin/climagic
|
|
40
|
+
- test/test_climagic.rb
|
|
41
|
+
homepage: http://rubygems.org/gems/xkcd
|
|
42
|
+
licenses: []
|
|
43
|
+
post_install_message:
|
|
44
|
+
rdoc_options: []
|
|
45
|
+
require_paths:
|
|
46
|
+
- lib
|
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
|
+
none: false
|
|
49
|
+
requirements:
|
|
50
|
+
- - ! '>='
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
|
+
none: false
|
|
55
|
+
requirements:
|
|
56
|
+
- - ! '>='
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '0'
|
|
59
|
+
requirements: []
|
|
60
|
+
rubyforge_project:
|
|
61
|
+
rubygems_version: 1.8.24
|
|
62
|
+
signing_key:
|
|
63
|
+
specification_version: 3
|
|
64
|
+
summary: Command of the day from climagic.org
|
|
65
|
+
test_files:
|
|
66
|
+
- test/test_climagic.rb
|