stackbuilders-campfire_export 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/bin/campfire_export +1 -1
- data/lib/campfire_export/version.rb +1 -1
- data/spec/campfire_export/account_spec.rb +6 -7
- data/spec/campfire_export/room_spec.rb +0 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9091b99d9d162b7df38f18c596d0721824fbbf0c
|
4
|
+
data.tar.gz: be9d6f9c487e660c30702d8c884746159a8c3dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be7807f8d34968d4d2797d8b91c2384db5c647566ac19ce1174360d8badddff586b0bde8798c3d26205ec0bc4e55f7872357f2c8afedd1ab64e4ae41e551462a
|
7
|
+
data.tar.gz: ec3362829e4d60315fe19b31284a110464814b600661f81ee88446d7531935c365f7993e5555708e59024da5f746b370007a2ad7c9589a8e518f93c4a7625c53
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## Quick Start ##
|
6
6
|
|
7
|
-
$
|
7
|
+
$ gem install stackbuilders-campfire_export
|
8
8
|
$ campfire_export
|
9
9
|
|
10
10
|
## Note ##
|
@@ -58,21 +58,21 @@ recommend having the latest version of RubyGems installed before starting.
|
|
58
58
|
|
59
59
|
Once you are set up, to install, run the following:
|
60
60
|
|
61
|
-
$
|
61
|
+
$ gem install campfire_export
|
62
62
|
|
63
63
|
## Configuring ##
|
64
64
|
|
65
65
|
There are a number of configuration variables required to run the export. The
|
66
66
|
export script will prompt you for these; just run it and away you go. If you
|
67
67
|
want to run the script repeatedly or want to control the start and end date of
|
68
|
-
the export, you can create a `.campfire_export.
|
68
|
+
the export, you can create a `.campfire_export.yml` file in your home
|
69
69
|
directory using this template:
|
70
70
|
|
71
71
|
# Your Campfire subdomain (for 'https://myco.campfirenow.com', use 'myco').
|
72
72
|
subdomain: myco
|
73
73
|
|
74
74
|
# Your Campfire API token (see "My Info" on your Campfire site).
|
75
|
-
api_token:
|
75
|
+
api_token: your-campfire-token
|
76
76
|
|
77
77
|
# OPTIONAL: Export start date - the first transcript you want exported.
|
78
78
|
# Uncomment to set. Defaults to the date each room was created.
|
data/bin/campfire_export
CHANGED
@@ -42,7 +42,7 @@ def ensure_config_for(config, key, prompt)
|
|
42
42
|
end
|
43
43
|
|
44
44
|
config = {}
|
45
|
-
config_file = File.join(ENV['HOME'], '.campfire_export.
|
45
|
+
config_file = File.join(ENV['HOME'], '.campfire_export.yml')
|
46
46
|
|
47
47
|
if File.exists?(config_file) and File.readable?(config_file)
|
48
48
|
config = YAML.load_file(config_file)
|
@@ -22,7 +22,7 @@ module CampfireExport
|
|
22
22
|
|
23
23
|
@bad_timezone = @good_timezone.gsub('America/Los_Angeles',
|
24
24
|
'No Such Timezone')
|
25
|
-
@account_xml =
|
25
|
+
@account_xml = double("Account XML")
|
26
26
|
@account_xml.stub(:body).and_return(@good_timezone)
|
27
27
|
end
|
28
28
|
|
@@ -64,18 +64,17 @@ module CampfireExport
|
|
64
64
|
context "when rooms are requested" do
|
65
65
|
it "returns an array of rooms" do
|
66
66
|
room_xml = "<rooms><room>1</room><room>2</room><room>3</room></rooms>"
|
67
|
-
room_doc =
|
67
|
+
room_doc = double("room doc")
|
68
68
|
room_doc.should_receive(:body).and_return(room_xml)
|
69
69
|
@account.should_receive(:get).with('/rooms.xml').and_return(room_doc)
|
70
|
-
room =
|
70
|
+
room = double("room")
|
71
71
|
Room.should_receive(:new).exactly(3).times.and_return(room)
|
72
|
-
@account.rooms.
|
72
|
+
expect(@account.rooms.size).to eq(3)
|
73
73
|
end
|
74
74
|
|
75
75
|
it "raises an error if it can't get the room list" do
|
76
|
-
@account.
|
77
|
-
|
78
|
-
"Not Found", 404))
|
76
|
+
allow(@account).to receive(:get).with('/rooms.xml') { raise(CampfireExport::Exception.new('/rooms.xml', "Not Found", 404)) }
|
77
|
+
|
79
78
|
expect {
|
80
79
|
@account.rooms
|
81
80
|
}.to raise_error(CampfireExport::Exception)
|