qotd 1.3.0 → 2.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.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/bin/qotd +21 -13
- data/lib/public/default.css +67 -0
- data/lib/qotd/version.rb +1 -1
- data/lib/qweb.rb +10 -0
- data/lib/views/fancy.erb +4 -0
- data/lib/views/layout.erb +23 -0
- data/qotd.gemspec +2 -1
- data/spec/qweb_spec.rb +13 -0
- data/spec/spec_helper.rb +12 -0
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9c60639e62a9928072dc2d06377d6857b25e93c
|
4
|
+
data.tar.gz: 7a800932681b2e6a69f9dbeab1ac95f2c89b0ab4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9446ba0cb8fcbfcad35455dd896ca262f49467201b909cef7949249d1b778d508567a7d045437afb78bb7e1a2e82b0b84f01368b512c0975771e3982b697f6f
|
7
|
+
data.tar.gz: 7fe7f0e8c1d38c8c4e028b442f159f5b8d8f7f36be690b1546dc9d4d127720197ebff04cd097aa04397f793173e55ac1ae9856f19af6817afc3ca985961cb036
|
data/README.md
CHANGED
data/bin/qotd
CHANGED
@@ -1,22 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# The first argument can be used as a quote to print
|
4
|
-
#
|
3
|
+
# The first argument can be used as a quote to print. If the arg is '--web',
|
4
|
+
# then a Sinatra application will launch and display quotes on localhost:4567.
|
5
|
+
# If no arguments given, rint a random quote from the quotes file.
|
5
6
|
|
6
7
|
require 'qotd'
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
if ARGV.first
|
12
|
-
quote = Format.format_quote(ARGV.first)
|
9
|
+
if ARGV.first == "--web"
|
10
|
+
`open http://localhost:4567`
|
11
|
+
`ruby lib/qweb.rb`
|
13
12
|
else
|
14
|
-
quote = Format.format_quote(Qotd.quote)
|
15
|
-
end
|
16
13
|
|
17
|
-
|
14
|
+
puts "Quote of the Day:"
|
15
|
+
|
16
|
+
quote = []
|
17
|
+
if ARGV.first
|
18
|
+
quote = Format.format_quote(ARGV.first)
|
19
|
+
else
|
20
|
+
quote = Format.format_quote(Qotd.quote)
|
21
|
+
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
print quote[
|
23
|
+
last = quote.length - 1
|
24
|
+
|
25
|
+
print quote[0]
|
26
|
+
puts quote[(1...last)]
|
27
|
+
print quote[last]
|
28
|
+
|
29
|
+
end
|
22
30
|
|
@@ -0,0 +1,67 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #666;
|
3
|
+
color: #999;
|
4
|
+
font-family: "Georgia", "Times New Roman", "Times", Serif;
|
5
|
+
-webkit-font-smoothing: antialiased;
|
6
|
+
}
|
7
|
+
|
8
|
+
button {
|
9
|
+
height: 100%;
|
10
|
+
width: 100%;
|
11
|
+
border: 0.5em double #787878;
|
12
|
+
background-color: #333;
|
13
|
+
color: inherit;
|
14
|
+
}
|
15
|
+
|
16
|
+
button:hover {
|
17
|
+
cursor: pointer;
|
18
|
+
}
|
19
|
+
|
20
|
+
div#page {
|
21
|
+
margin: 3em 25%;
|
22
|
+
}
|
23
|
+
|
24
|
+
div#info {
|
25
|
+
position: fixed;
|
26
|
+
top: 80px;
|
27
|
+
left: 50%;
|
28
|
+
width: 600px;
|
29
|
+
margin-left: -300px;
|
30
|
+
}
|
31
|
+
|
32
|
+
div#title {
|
33
|
+
position: fixed;
|
34
|
+
top: 1em;
|
35
|
+
left: 50%;
|
36
|
+
height: 100px;
|
37
|
+
width: 600px;
|
38
|
+
margin-left: -300px;
|
39
|
+
}
|
40
|
+
|
41
|
+
div#quote {
|
42
|
+
position: fixed;
|
43
|
+
width: 600px;
|
44
|
+
top: 35%;
|
45
|
+
left: 50%;
|
46
|
+
margin-left: -300px;
|
47
|
+
}
|
48
|
+
|
49
|
+
h1 {
|
50
|
+
text-align: center;
|
51
|
+
font-size: 4em;
|
52
|
+
font-weight: lighter;
|
53
|
+
}
|
54
|
+
|
55
|
+
h2 {
|
56
|
+
text-align: center;
|
57
|
+
font-size: 1em;
|
58
|
+
font-weight: lighter;
|
59
|
+
}
|
60
|
+
|
61
|
+
p {
|
62
|
+
margin: 0;
|
63
|
+
text-align: center;
|
64
|
+
font-size: 3em;
|
65
|
+
font-family: "Georgia", "Times New Roman", "Times", Serif;
|
66
|
+
}
|
67
|
+
|
data/lib/qotd/version.rb
CHANGED
data/lib/qweb.rb
ADDED
data/lib/views/fancy.erb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Quote of the Day</title>
|
4
|
+
<link type="text/css" rel="stylesheet" href="default.css" />
|
5
|
+
<meta http-equiv="refresh" content="60" />
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<button type="button" onclick="history.go(0)">
|
9
|
+
<div id="page">
|
10
|
+
<div id="info">
|
11
|
+
<h2>Click to go to next quote.</h2>
|
12
|
+
</div>
|
13
|
+
<div id="title">
|
14
|
+
<h1>Quote of the Day</h1>
|
15
|
+
</div>
|
16
|
+
<div id="quote">
|
17
|
+
<%= yield %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</button>
|
21
|
+
</body>
|
22
|
+
</html>
|
23
|
+
|
data/qotd.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
-
spec.add_development_dependency "rake", "~>
|
22
|
+
spec.add_development_dependency "rake", "~> 1.4"
|
23
|
+
spec.add_development_dependency "sinatra", "~> 10.1"
|
23
24
|
spec.add_development_dependency "rspec", "~> 2.14"
|
24
25
|
end
|
data/spec/qweb_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qotd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfjhh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -26,6 +26,20 @@ dependencies:
|
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sinatra
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ~>
|
@@ -67,13 +81,19 @@ files:
|
|
67
81
|
- Rakefile
|
68
82
|
- bin/qotd
|
69
83
|
- lib/format.rb
|
84
|
+
- lib/public/default.css
|
70
85
|
- lib/qotd.rb
|
71
86
|
- lib/qotd/version.rb
|
72
87
|
- lib/quotes/quotes.txt
|
88
|
+
- lib/qweb.rb
|
89
|
+
- lib/views/fancy.erb
|
90
|
+
- lib/views/layout.erb
|
73
91
|
- qotd.gemspec
|
74
92
|
- screenshot/screenshot.png
|
75
93
|
- spec/format_spec.rb
|
76
94
|
- spec/qotd_spec.rb
|
95
|
+
- spec/qweb_spec.rb
|
96
|
+
- spec/spec_helper.rb
|
77
97
|
homepage: https://github.com/jfjhh/qotd
|
78
98
|
licenses:
|
79
99
|
- MIT
|
@@ -101,4 +121,6 @@ summary: Displays a new quote on login to terminal.
|
|
101
121
|
test_files:
|
102
122
|
- spec/format_spec.rb
|
103
123
|
- spec/qotd_spec.rb
|
124
|
+
- spec/qweb_spec.rb
|
125
|
+
- spec/spec_helper.rb
|
104
126
|
has_rdoc:
|