easylittleprinter 0.2.0 → 0.2.1

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/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
- Presently, this gem works for standalone machines. Heroku support is
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
- == Usage
26
+ == Required Environmental Variables
28
27
 
29
- "require 'easylittleprinter'"
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
- "EasyLittlePrinter.do"
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
- or, from the command like
36
+ The following are the options for the FREQUENCY variable:
34
37
 
35
- "easylittleprinter"
38
+ every_monday, every_tuesday, every_wednesday, every_thursday, every_friday, every_saturday, every_sunday, everyday, every_mwf
36
39
 
37
- Both of these start The Camping Server running the site.
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
- == Configuration
42
+ == Deploying to Heroku
40
43
 
41
- You'll need to have a config file. The default location for it is
42
- /etc/easylittleprinter/lpconfig.rb
44
+ Create a config.ru file containing:
43
45
 
44
- A template is provided in docs/lpconfig_sample.rb
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
@@ -25,7 +25,6 @@ Jeweler::Tasks.new do |gem|
25
25
  gem.add_dependency "markaby"
26
26
  gem.add_dependency "builder"
27
27
  gem.add_dependency "rack"
28
- gem.executables = ['easylittleprinter']
29
28
  end
30
29
  Jeweler::RubygemsDotOrgTasks.new
31
30
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,14 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "easylittleprinter"
8
- s.version = "0.2.0"
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",
@@ -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 userDate.monday? == true #change to .tuesday? etc, depending on the desired day
40
- render :currentEdition
41
- else
42
- r(200, "Error 200. Nothing to report, boss")
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.0
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: 2408002248723944556
259
+ hash: -3445475581671949492
262
260
  required_rubygems_version: !ruby/object:Gem::Requirement
263
261
  none: false
264
262
  requirements:
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'easylittleprinter'
4
-
5
- EasyLittlePrinter.do