campfire 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm --create 1.9.2@campfire
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in campfire.gemspec
4
+ gemspec
@@ -0,0 +1,41 @@
1
+ ## campfire - Command Line Interface for Campfire
2
+
3
+ Usage
4
+ -----
5
+ gem install campfire
6
+
7
+ ### Config
8
+ Create a `~/.campfirerc` and add the following lines:
9
+ account=<<ACCOUNT NAME>>
10
+ room=<<ROOM NAME>>
11
+ token=<<TOKEN>>
12
+
13
+ OR
14
+
15
+ Use environment variables:
16
+ ➜ account="foo" room="room" token="token" campfire "Woot"
17
+
18
+ ### Post a message to a room
19
+ ➜ campfire "Woot"
20
+
21
+ ### Post a meme image to Campfire
22
+ ➜ meme CHALLENGE_ACCEPTED "Campfire Message" "Hell yeah" | imgur2 | campfire
23
+
24
+ ## Note on Patches/Pull Requests
25
+
26
+ * Fork the project.
27
+ * Make your feature addition or bug fix.
28
+ * Add tests for it. This is important so I don't break it in a
29
+ future version unintentionally.
30
+ * Commit, do not mess with rakefile, version, or history.
31
+ * Send me a pull request. Bonus points for topic branches.
32
+
33
+ ## Authors
34
+
35
+ * Mark Turner <mark@amerine.net>
36
+ * Chris Kraybill <ckraybill@gmail.com>
37
+ * Luke Sheridan <luke@windmillium.com>
38
+
39
+ ## Copyright
40
+
41
+ Copyright (c) 2011
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'campfire'
4
+
5
+ Campfire::Runner.run ARGV
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "campfire/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "campfire"
7
+ s.version = Campfire::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Mark Turner", "Chris Kraybill", "Luke Sheridan"]
10
+ s.email = ["mark@amerine.net", "ckraybill@gmail.com", "luke@windmillium.com"]
11
+ s.homepage = ""
12
+ s.summary = "Command line interface for campfire"
13
+ s.description = "Command line interface for campfire"
14
+
15
+ s.rubyforge_project = "campfire"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency "tinder", "~> 1.4.3"
23
+ end
@@ -0,0 +1,36 @@
1
+ require 'tinder'
2
+
3
+ module Campfire
4
+ class Runner
5
+ def self.run(args)
6
+ Campfire::Config.load_config
7
+ abort "No Config" if Campfire::Config.config_value('account').blank?
8
+ campfire = Tinder::Campfire.new Campfire::Config.config_value('account'),
9
+ :ssl => true, :token => Campfire::Config.config_value('token')
10
+ room = campfire.find_room_by_name Campfire::Config.config_value('room')
11
+ if args.length > 0
12
+ room.speak "#{args.first}"
13
+ else
14
+ room.speak $stdin.read
15
+ end
16
+ end
17
+ end
18
+
19
+ class Config
20
+ def self.config
21
+ @config ||= {}
22
+ end
23
+
24
+ def self.config_value(value)
25
+ value = value.to_s
26
+ config[value] || ENV[value]
27
+ end
28
+
29
+ def self.load_config
30
+ IO.foreach(File.join(Dir.home, '.campfirerc')) do |conf|
31
+ k,v = conf.split("=")
32
+ config[k.strip]=v.strip
33
+ end rescue Errno::ENOENT
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,3 @@
1
+ module Campfire
2
+ VERSION = "0.0.5"
3
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: campfire
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.5
6
+ platform: ruby
7
+ authors:
8
+ - Mark Turner
9
+ - Chris Kraybill
10
+ - Luke Sheridan
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+
15
+ date: 2011-03-31 00:00:00 -07:00
16
+ default_executable:
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: tinder
20
+ prerelease: false
21
+ requirement: &id001 !ruby/object:Gem::Requirement
22
+ none: false
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.4.3
27
+ type: :runtime
28
+ version_requirements: *id001
29
+ description: Command line interface for campfire
30
+ email:
31
+ - mark@amerine.net
32
+ - ckraybill@gmail.com
33
+ - luke@windmillium.com
34
+ executables:
35
+ - campfire
36
+ extensions: []
37
+
38
+ extra_rdoc_files: []
39
+
40
+ files:
41
+ - .gitignore
42
+ - .rvmrc
43
+ - Gemfile
44
+ - README.md
45
+ - Rakefile
46
+ - bin/campfire
47
+ - campfire.gemspec
48
+ - lib/campfire.rb
49
+ - lib/campfire/version.rb
50
+ has_rdoc: true
51
+ homepage: ""
52
+ licenses: []
53
+
54
+ post_install_message:
55
+ rdoc_options: []
56
+
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ requirements: []
72
+
73
+ rubyforge_project: campfire
74
+ rubygems_version: 1.6.2
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Command line interface for campfire
78
+ test_files: []
79
+