easylittleprinter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +45 -12
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/easylittleprinter.gemspec +1 -3
- data/lib/easylittleprinter.rb +51 -11
- metadata +3 -5
- data/bin/easylittleprinter +0 -5
data/README.rdoc
CHANGED
@@ -9,8 +9,7 @@ Incidentally, Github Pages works fantastically as a remote static server.
|
|
9
9
|
You could probably set it up so that you don't have to use a remote server,
|
10
10
|
but that ain't no fun.
|
11
11
|
|
12
|
-
|
13
|
-
coming soon.
|
12
|
+
You can either run this guy locally, or on heroku.
|
14
13
|
|
15
14
|
== Installation
|
16
15
|
|
@@ -24,24 +23,58 @@ yyyy-mm-dd
|
|
24
23
|
|
25
24
|
The file extension is specified in the configuration file
|
26
25
|
|
27
|
-
==
|
26
|
+
== Required Environmental Variables
|
28
27
|
|
29
|
-
|
28
|
+
EXTENSION , the file extension for all of your images. Pick one. The icon will always be .png
|
29
|
+
HOSTURL , the address of your static image host, e.g. http://yourname.github.com . NO TRAILING SLASH!
|
30
|
+
TITLE , the title of the pages with images on them. Purely cosmetic.
|
31
|
+
SAMPLE , the filename of the sample image, no slashes, no extensions
|
32
|
+
ICON , the filename of the icon image, no slashes, no extensions. Must be a png.
|
30
33
|
|
31
|
-
|
34
|
+
You can configure the application to publish on certain days. Non-temporally-bound publications are not supported at this time. You can totally mod my code if you want, though.
|
32
35
|
|
33
|
-
|
36
|
+
The following are the options for the FREQUENCY variable:
|
34
37
|
|
35
|
-
|
38
|
+
every_monday, every_tuesday, every_wednesday, every_thursday, every_friday, every_saturday, every_sunday, everyday, every_mwf
|
36
39
|
|
37
|
-
|
40
|
+
NOTE!!! Once the user passes the check to make sure the date they're accessing from is within your publishing specs, the server will then attempt to serve an image with a corresponding filename, e.g. 2012-08-30.png See above for more information.
|
38
41
|
|
39
|
-
==
|
42
|
+
== Deploying to Heroku
|
40
43
|
|
41
|
-
|
42
|
-
/etc/easylittleprinter/lpconfig.rb
|
44
|
+
Create a config.ru file containing:
|
43
45
|
|
44
|
-
|
46
|
+
|
47
|
+
require 'easylittleprinter'
|
48
|
+
|
49
|
+
run easylittleprinter
|
50
|
+
|
51
|
+
|
52
|
+
This part of the process can also be used for deploying to a physical server.
|
53
|
+
|
54
|
+
You'll also need a Gemfile:
|
55
|
+
|
56
|
+
|
57
|
+
source :rubygems
|
58
|
+
|
59
|
+
gem "easylittleprinter", ">=0.2.1"
|
60
|
+
|
61
|
+
gem "camping"
|
62
|
+
|
63
|
+
gem "markaby"
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
Initialize a git repo in the folder where your files are, add them, commit
|
68
|
+
|
69
|
+
Then run "heroku create {your app anme here, minus brackets}"
|
70
|
+
|
71
|
+
Then run "git push heroku master"
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
Next, set your environment variables with "heroku config:add {put the vars here}
|
76
|
+
|
77
|
+
You're done!
|
45
78
|
|
46
79
|
== Contributing to easylittleprinter
|
47
80
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/easylittleprinter.gemspec
CHANGED
@@ -5,14 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "easylittleprinter"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Simon Orr"]
|
12
12
|
s.date = "2012-08-22"
|
13
13
|
s.description = "Serves static images from a remote server on the dates assigned in their filenames to BERG Cloud"
|
14
14
|
s.email = "simon@simonorrstudio.com"
|
15
|
-
s.executables = ["easylittleprinter"]
|
16
15
|
s.extra_rdoc_files = [
|
17
16
|
"LICENSE.txt",
|
18
17
|
"README.rdoc"
|
@@ -26,7 +25,6 @@ Gem::Specification.new do |s|
|
|
26
25
|
"Rakefile",
|
27
26
|
"VERSION",
|
28
27
|
"bin.easylittleprinter",
|
29
|
-
"bin/easylittleprinter",
|
30
28
|
"docs/lpconfig_sample.rb",
|
31
29
|
"easylittleprinter.gemspec",
|
32
30
|
"lib/easylittleprinter.rb",
|
data/lib/easylittleprinter.rb
CHANGED
@@ -10,6 +10,7 @@ $imgHostURL = ENV['HOSTURL']
|
|
10
10
|
$title = ENV['TITLE']
|
11
11
|
$sampleImg = ENV['SAMPLE']
|
12
12
|
$iconImg = ENV['ICON']
|
13
|
+
$publishes = EVN['FREQUENCY']
|
13
14
|
|
14
15
|
module LPImgApp::Controllers
|
15
16
|
|
@@ -36,10 +37,56 @@ module LPImgApp::Controllers
|
|
36
37
|
else
|
37
38
|
userDate = Date.new
|
38
39
|
userDate = Time.parse(@passedLDT)
|
39
|
-
if
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
if $publishes = "every_monday"
|
41
|
+
if userDate.monday? == true
|
42
|
+
render :currentEdition
|
43
|
+
else
|
44
|
+
r(200, "Error 200. Nothing to report, boss")
|
45
|
+
end
|
46
|
+
elseif $publishes = "every_tuesday"
|
47
|
+
if userDate.tuesday? == true
|
48
|
+
render :currentEdition
|
49
|
+
else
|
50
|
+
r(200, "Error 200. Nothing to report, boss")
|
51
|
+
end
|
52
|
+
elseif $publishes = "every_wednesday"
|
53
|
+
if userDate.wednesday? == true
|
54
|
+
render :currentEdition
|
55
|
+
else
|
56
|
+
r(200, "Error 200. Nothing to report, boss")
|
57
|
+
end
|
58
|
+
elseif $publishes = "every_thursday"
|
59
|
+
if userDate.thursday? == true
|
60
|
+
render :currentEdition
|
61
|
+
else
|
62
|
+
r(200, "Error 200. Nothing to report, boss")
|
63
|
+
end
|
64
|
+
elseif $publishes = "every_friday"
|
65
|
+
if userDate.friday? == true
|
66
|
+
render :currentEdition
|
67
|
+
else
|
68
|
+
r(200, "Error 200. Nothing to report, boss")
|
69
|
+
end
|
70
|
+
elseif $publishes = "every_saturday"
|
71
|
+
if userDate.saturday? == true
|
72
|
+
render :currentEdition
|
73
|
+
else
|
74
|
+
r(200, "Error 200. Nothing to report, boss")
|
75
|
+
end
|
76
|
+
elseif $publishes = "every_sunday"
|
77
|
+
if userDate.sunday? == true
|
78
|
+
render :currentEdition
|
79
|
+
else
|
80
|
+
r(200, "Error 200. Nothing to report, boss")
|
81
|
+
end
|
82
|
+
elseif $publishes = "everyday"
|
83
|
+
render :currentEdition
|
84
|
+
elseif $publishes = "every_mwf"
|
85
|
+
if userDate.monday? == true or userDate.wednesday? == true or userDate.friday? == true
|
86
|
+
render :currentEdition
|
87
|
+
else
|
88
|
+
r(200, "Error 200. Nothing to report, boss")
|
89
|
+
end
|
43
90
|
end
|
44
91
|
end
|
45
92
|
end
|
@@ -108,10 +155,3 @@ module LPImgApp::Views
|
|
108
155
|
end
|
109
156
|
|
110
157
|
end
|
111
|
-
|
112
|
-
module EasyLittlePrinter
|
113
|
-
|
114
|
-
def self.do
|
115
|
-
exec('camping ' + Dir.getwd)
|
116
|
-
end
|
117
|
-
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easylittleprinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -222,8 +222,7 @@ dependencies:
|
|
222
222
|
description: Serves static images from a remote server on the dates assigned in their
|
223
223
|
filenames to BERG Cloud
|
224
224
|
email: simon@simonorrstudio.com
|
225
|
-
executables:
|
226
|
-
- easylittleprinter
|
225
|
+
executables: []
|
227
226
|
extensions: []
|
228
227
|
extra_rdoc_files:
|
229
228
|
- LICENSE.txt
|
@@ -237,7 +236,6 @@ files:
|
|
237
236
|
- Rakefile
|
238
237
|
- VERSION
|
239
238
|
- bin.easylittleprinter
|
240
|
-
- bin/easylittleprinter
|
241
239
|
- docs/lpconfig_sample.rb
|
242
240
|
- easylittleprinter.gemspec
|
243
241
|
- lib/easylittleprinter.rb
|
@@ -258,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
258
256
|
version: '0'
|
259
257
|
segments:
|
260
258
|
- 0
|
261
|
-
hash:
|
259
|
+
hash: -3445475581671949492
|
262
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
261
|
none: false
|
264
262
|
requirements:
|