printable_calendar 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfef90094976103b1e05f76b6f594f726c5a767d
4
- data.tar.gz: bb780212014caf493a48f4941407dbce24267938
3
+ metadata.gz: 2a8d8ded10c1bc88f6a8091ad74257e6d5089ed0
4
+ data.tar.gz: 165174a4136e719bdc5122546c4c43bb32619a3b
5
5
  SHA512:
6
- metadata.gz: 48eb4980c1c0638314413ecc58914058bae262e678e0fdad8eb85faa215cc3f8faf7d6197f6577fe7dc1588d63dc6e2036f78815f602e947903da557eb332c50
7
- data.tar.gz: 841e3a6783a41cfab5779c222dd28bcf06fbd009242f0644b3ca9b28da06b43b72c15738b98bf78539e3cd8235f5bfc0477911f447d50e30cdb47c8eaae12c12
6
+ metadata.gz: 2518be111d5df3b65172613e607c9922b7ed2415f43ff6a3280d33da232466785bf670de4b68dfd52717ccfe6018df7b9023e7057db41b1fa5aaed654d67b88c
7
+ data.tar.gz: 385487c0218db4bc0b75d11d971928ae10f7d17f73a78590764f77debbcce6b79236c5244d0a5f73aede1a22d3100ca063c17ff657e663c3162a791f59d7ba3f
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require "bundler/setup"
4
3
  require "slop"
5
- require "printable_calendar"
6
- require 'active_support/core_ext/hash/slice'
4
+ require "active_support/core_ext/hash/slice"
5
+
6
+ require_relative "../lib/printable_calendar"
7
7
 
8
8
  def load_config_file(file)
9
9
  if File.exist?(file)
@@ -16,13 +16,14 @@ end
16
16
  opts = Slop.parse do |o|
17
17
  o.bool "-g", "--generate", "generate a token"
18
18
  o.bool "-h", "--help", "print help"
19
+ o.bool "-v", "--version", "print version info"
19
20
  o.string "-c", "--config", "use a JSON config file"
20
21
  o.string "--client-id", "Google client id"
21
22
  o.string "--client-secret", "Google client secret"
22
23
  o.string "--refresh-token", "Google refresh token"
23
- o.string "--period", "Time period to use"
24
- o.string "--title", "Title for this calendar"
25
- o.string "--starting-from", "Date to start showing. Defaults to today. YYYY-MM-DD"
24
+ o.string "--period", "time period to use"
25
+ o.string "--title", "title for this calendar"
26
+ o.string "--starting-from", "date to start showing. Defaults to today. YYYY-MM-DD"
26
27
  o.array "--calendar-ids", "Google calendar IDs"
27
28
  end
28
29
 
@@ -36,5 +37,6 @@ printable = PrintableCalendar::PrintableCalendar.new(settings)
36
37
  case
37
38
  when opts[:help] then puts opts
38
39
  when opts[:generate] then printable.generate_auth
40
+ when opts[:version] then puts PrintableCalendar::VERSION
39
41
  else printable.run
40
42
  end
@@ -1,9 +1,9 @@
1
1
  require "json"
2
2
  require "tempfile"
3
3
  require "launchy"
4
- require_relative "range"
5
- require_relative "calendar"
6
- require_relative "view"
4
+ require_relative "printable_calendar/range"
5
+ require_relative "printable_calendar/calendar"
6
+ require_relative "printable_calendar/view"
7
7
 
8
8
  module PrintableCalendar
9
9
  class PrintableCalendar
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ module PrintableCalendar
2
+ VERSION = "0.0.2"
3
+ end
@@ -1,8 +1,10 @@
1
1
  # coding: utf-8
2
- require "erector"
2
+ require "fortitude"
3
3
 
4
4
  module PrintableCalendar
5
- class View < Erector::Widget
5
+ class View < Fortitude::Widget
6
+
7
+ doctype(:html5)
6
8
 
7
9
  def initialize(settings, starts, ends, data)
8
10
  @settings = settings
@@ -16,6 +18,7 @@ module PrintableCalendar
16
18
 
17
19
  html {
18
20
  head {
21
+ meta(charset: "UTF-8")
19
22
  title(title_text)
20
23
  style(bootstrap)
21
24
  style(overrides)
@@ -47,20 +50,23 @@ module PrintableCalendar
47
50
  end
48
51
 
49
52
  def bootstrap
50
- File.read(File.expand_path("../../vendor/bootstrap.min.css", __FILE__))
53
+ File.read(File.expand_path("../../../vendor/bootstrap.min.css", __FILE__))
51
54
  end
52
55
 
53
56
  def overrides
54
57
  <<-eos
55
- tr {padding-bottom: 25px;}
56
- tr:nth-child(odd) { background-color: #eceeef}
58
+ tr {padding-bottom: 35px;}
59
+ tr:nth-child(odd) {
60
+ background-color: #eceeef !important;
61
+ -webkit-print-color-adjust: exact !important;
62
+ }
57
63
  tr:nth-child(odd) td[rowspan]{
58
- background-color: white !important;
64
+ background-color: white !important;
65
+ -webkit-print-color-adjust: exact !important;
59
66
  }
60
67
  eos
61
68
  end
62
69
 
63
-
64
70
  def title_text
65
71
  t = @settings[:title] || "Calendar"
66
72
  "#{t} for #{format_date(@starts, false)} – #{format_date(@ends, false)}"
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module PrintableCalendar
2
+ VERSION = "0.0.2"
3
+ end
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "printable_calendar/version"
4
5
 
5
6
  Gem::Specification.new do |spec|
6
7
  spec.name = "printable_calendar"
7
- spec.version = "0.0.1"
8
+ spec.version = PrintableCalendar::VERSION
8
9
  spec.authors = ["Isaac Cambron"]
9
10
  spec.email = ["isaac@isaaccambron.com"]
10
11
 
@@ -17,12 +18,15 @@ Gem::Specification.new do |spec|
17
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
19
  spec.require_paths = ["lib"]
19
20
 
21
+ spec.executables << "printable_calendar"
22
+
20
23
  spec.add_dependency "google_calendar", "~> 0.6"
21
- spec.add_dependency "erector", "~> 0.10"
24
+ spec.add_dependency "fortitude", "~> 0.9"
22
25
  spec.add_dependency "activesupport", "~> 5.0"
23
26
  spec.add_dependency "slop", "~> 4.4"
24
27
  spec.add_dependency "launchy", "~> 2.4"
25
28
 
26
29
  spec.add_development_dependency "bundler", "~> 1.11"
27
30
  spec.add_development_dependency "rake", "~> 10.0"
31
+
28
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: printable_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Cambron
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: erector
28
+ name: fortitude
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.10'
33
+ version: '0.9'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.10'
40
+ version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +111,8 @@ dependencies:
111
111
  description:
112
112
  email:
113
113
  - isaac@isaaccambron.com
114
- executables: []
114
+ executables:
115
+ - printable_calendar
115
116
  extensions: []
116
117
  extra_rdoc_files: []
117
118
  files:
@@ -121,12 +122,14 @@ files:
121
122
  - README.md
122
123
  - Rakefile
123
124
  - bin/console
124
- - bin/printable_calendar
125
125
  - bin/setup
126
- - lib/calendar.rb
126
+ - exe/printable_calendar
127
127
  - lib/printable_calendar.rb
128
- - lib/range.rb
129
- - lib/view.rb
128
+ - lib/printable_calendar/calendar.rb
129
+ - lib/printable_calendar/range.rb
130
+ - lib/printable_calendar/version.rb
131
+ - lib/printable_calendar/view.rb
132
+ - lib/version.rb
130
133
  - printable_calendar.gemspec
131
134
  - sample-config.json
132
135
  - vendor/bootstrap.min.css