badslava2csv 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6c06fa961ad0caa9b8dd9d3de2c7c5205e46c80
4
- data.tar.gz: 1477b06cb3197c347be94767db0c4401d10158c9
3
+ metadata.gz: 336537c69b82749fd9b9335822cbb2d2acb60f3f
4
+ data.tar.gz: a5bbec32e84e6472c7b86fc888d20465b0a8abce
5
5
  SHA512:
6
- metadata.gz: 35c613990166ef8f0e61742d9b66fe5c6650ea3b683ea68ead6c7dfb0c62b7d843e8ca69f0e6f93260b0acaf014acaf02f1a9439fceaa0620bacb92a31b8f805
7
- data.tar.gz: 6d356a6d175c3c861935850ddfff7ddf83ee2238526360c7f7cf1e374c00211e3c9670a41cd4f608274b7973e9278a69ed3b66ddb146a8dbb9fce5c198c03c23
6
+ metadata.gz: 394308e6731a7ad0504ffed29e702f25e8ee9b816b62f4b76d6e82cf03fb89a727637b1be4d30f8dc1b00a504450298a8551dbbbf10cd7d0a59369081b7e89e7
7
+ data.tar.gz: fb16113abd847b1caf5564447306661e0347d45f8daafec8c6f7748f957d2a1b2a294c3c73708fd596d4108e5f9e84384f367866e49c4f1c53f4b36bb3dbabd4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -2,19 +2,19 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: badslava2csv 0.0.4 ruby lib
5
+ # stub: badslava2csv 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "badslava2csv"
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["brettshollenberger"]
14
- s.date = "2017-01-14"
14
+ s.date = "2017-01-15"
15
15
  s.description = "Import Badslava events to Google Calendar"
16
16
  s.email = "brett.shollenberger@gmail.com"
17
- s.executables = ["badslava2csv"]
17
+ s.executables = ["badslava2csv", "cronjob"]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE.txt",
20
20
  "README.md"
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "badslava2csv.gemspec",
32
32
  "badslava_import.gemspec",
33
33
  "bin/badslava2csv",
34
+ "bin/cronjob",
34
35
  "data/google.csv"
35
36
  ]
36
37
  s.homepage = "http://github.com/brettshollenberger/badslava2csv"
@@ -8,11 +8,11 @@ require "pathname"
8
8
  require "rake"
9
9
  require 'optparse'
10
10
 
11
- Options = Struct.new(:city, :output_dir)
11
+ Options = Struct.new(:city, :output_dir, :programmatic)
12
12
 
13
13
  class Parser
14
14
  def self.parse(options)
15
- args = Options.new("San Francisco", "./data")
15
+ args = Options.new("San Francisco", "./data", false)
16
16
 
17
17
  opt_parser = OptionParser.new do |opts|
18
18
  opts.banner = "Usage: badslava2csv [options]"
@@ -25,6 +25,10 @@ class Parser
25
25
  args.output_dir = output_dir
26
26
  end
27
27
 
28
+ opts.on("-p", "--programmatic", "Output Director") do
29
+ args.programmatic = true
30
+ end
31
+
28
32
  opts.on("-h", "--help", "Prints this help") do
29
33
  puts opts
30
34
  exit
@@ -37,10 +41,15 @@ class Parser
37
41
  end
38
42
  options = Parser.parse(ARGV)
39
43
 
40
- city = options.city
41
- output_dir = File.expand_path(options.output_dir)
44
+ city = options.city
45
+ output_dir = File.expand_path(options.output_dir)
46
+ @programmatic = options.programmatic
47
+
48
+ def pp(msg)
49
+ puts msg unless @programmatic
50
+ end
42
51
 
43
- puts "Listing events for #{city}"
52
+ pp "Listing events for #{city}"
44
53
 
45
54
  url = "http://badslava.com/open-mics.php?city=#{URI.encode(city)}&state=CA&type=Comedy"
46
55
  output_path = Pathname.new(output_dir)
@@ -99,4 +108,4 @@ CSV.open(path, "wb") do |csv|
99
108
  end
100
109
  end
101
110
 
102
- puts path
111
+ puts "{path: '#{path}'}"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ badslava2csv -p -o $(pwd)/data/google.csv -c "San Francisco" && terminal-notifier "import $(pwd)/data/google.csv"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badslava2csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - brettshollenberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -70,6 +70,7 @@ description: Import Badslava events to Google Calendar
70
70
  email: brett.shollenberger@gmail.com
71
71
  executables:
72
72
  - badslava2csv
73
+ - cronjob
73
74
  extensions: []
74
75
  extra_rdoc_files:
75
76
  - LICENSE.txt
@@ -86,6 +87,7 @@ files:
86
87
  - badslava2csv.gemspec
87
88
  - badslava_import.gemspec
88
89
  - bin/badslava2csv
90
+ - bin/cronjob
89
91
  - data/google.csv
90
92
  homepage: http://github.com/brettshollenberger/badslava2csv
91
93
  licenses: