badslava2csv 0.0.2 → 0.0.3

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: da1231f475614e7ec9c1c9e6dac95aeb681ca5f8
4
- data.tar.gz: f2be10ff674c1751e6e78b6ba1c1d73c8eca546f
3
+ metadata.gz: c088b8f354e7799fe7534e148a7099e54ad782c7
4
+ data.tar.gz: 098a77b0a09678853241d4e2507f8e2a64128178
5
5
  SHA512:
6
- metadata.gz: d57b70c2c2b6fe49b1a47c2c4891085176f8a4084602ceff0a1249a1ed7daeae4f70843b7d4a3be740b79410f81b7683e32d25b5f8f1464c2ecf3af702999fa1
7
- data.tar.gz: 17f5cfbb79b643f3dd92373ed8771228f0de922ed6dae24821e241e0b0518f5c7214a053e05cd84af23717074ef9a1118750a83af9c93987ff07e332fed1c7d1
6
+ metadata.gz: ab9f8f203d400ce7b4cc8433dbe8c9d5f1e0b4b89205d0bd3581f5642d00e03e63a9e45e0d603a0db2dc6a5ac02fe78e02055dd1e7575cea9936926923c5a036
7
+ data.tar.gz: e9dba78b2d5eb5e44ceb57f4ea5d32d5bba669e82401ebb83ff43adc62d1a3814917805c8bc8cc42616f6b06575801656e6b9e70240ac5d22e012375295edcfa
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -0,0 +1,62 @@
1
+ # Generated by juwelier
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: badslava2csv 0.0.3 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "badslava2csv"
9
+ s.version = "0.0.3"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["brettshollenberger"]
14
+ s.date = "2017-01-14"
15
+ s.description = "Import Badslava events to Google Calendar"
16
+ s.email = "brett.shollenberger@gmail.com"
17
+ s.executables = ["badslava2csv"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".DS_Store",
24
+ ".document",
25
+ "Gemfile",
26
+ "Gemfile.lock",
27
+ "LICENSE.txt",
28
+ "README.md",
29
+ "Rakefile",
30
+ "VERSION",
31
+ "badslava2csv.gemspec",
32
+ "badslava_import.gemspec",
33
+ "bin/badslava2csv",
34
+ "data/google.csv"
35
+ ]
36
+ s.homepage = "http://github.com/brettshollenberger/badslava2csv"
37
+ s.licenses = ["MIT"]
38
+ s.rubygems_version = "2.4.5.1"
39
+ s.summary = "Import Badslava events to Google Calendar"
40
+
41
+ if s.respond_to? :specification_version then
42
+ s.specification_version = 4
43
+
44
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6.8.1"])
46
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
47
+ s.add_development_dependency(%q<juwelier>, ["~> 2.1.0"])
48
+ s.add_development_dependency(%q<pry>, [">= 0"])
49
+ else
50
+ s.add_dependency(%q<nokogiri>, ["~> 1.6.8.1"])
51
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
52
+ s.add_dependency(%q<juwelier>, ["~> 2.1.0"])
53
+ s.add_dependency(%q<pry>, [">= 0"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<nokogiri>, ["~> 1.6.8.1"])
57
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
58
+ s.add_dependency(%q<juwelier>, ["~> 2.1.0"])
59
+ s.add_dependency(%q<pry>, [">= 0"])
60
+ end
61
+ end
62
+
data/bin/badslava2csv CHANGED
@@ -6,13 +6,44 @@ require "open-uri"
6
6
  require "csv"
7
7
  require "pathname"
8
8
  require "rake"
9
+ require 'optparse'
9
10
 
10
- city = ARGV[0] || "San Francisco"
11
+ Options = Struct.new(:city, :output_dir)
12
+
13
+ class Parser
14
+ def self.parse(options)
15
+ args = Options.new("world")
16
+
17
+ opt_parser = OptionParser.new do |opts|
18
+ opts.banner = "Usage: badslava2csv [options]"
19
+
20
+ opts.on("-cCITY", "--city=CITY", "City to list") do |city|
21
+ args.city = city
22
+ end
23
+
24
+ opts.on("-oOUTPUTDIR", "--output-dir=OUTPUTDIR", "Output Director") do |output_dir|
25
+ args.output_dir = output_dir
26
+ end
27
+
28
+ opts.on("-h", "--help", "Prints this help") do
29
+ puts opts
30
+ exit
31
+ end
32
+ end
33
+
34
+ opt_parser.parse!(options)
35
+ return args
36
+ end
37
+ end
38
+ options = Parser.parse(ARGV)
39
+
40
+ city = options.city || "San Francisco"
41
+ output_dir = File.expand_path(options.output_dir || "./data")
11
42
 
12
43
  puts "Listing events for #{city}"
13
44
 
14
45
  url = "http://badslava.com/open-mics.php?city=#{URI.encode(city)}&state=CA&type=Comedy"
15
- output_path = Pathname.new(File.expand_path("./data"))
46
+ output_path = Pathname.new(output_dir)
16
47
 
17
48
  FileUtils.mkdir_p(output_path)
18
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badslava2csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - brettshollenberger
@@ -83,6 +83,7 @@ files:
83
83
  - README.md
84
84
  - Rakefile
85
85
  - VERSION
86
+ - badslava2csv.gemspec
86
87
  - badslava_import.gemspec
87
88
  - bin/badslava2csv
88
89
  - data/google.csv