convore-simple 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "convore-simple"
4
- s.version = "0.0.6"
4
+ s.version = "0.0.7"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ["Micha Niskin"]
7
7
  s.email = ["micha.niskin@gmail.com"]
@@ -3,8 +3,21 @@ module ConvoreSimple
3
3
 
4
4
  class Topic
5
5
  def self.say(message)
6
- user = `git config user.convore`
7
- topic = `git config convore.topic`
6
+ user = `git config user.convore`.chop!
7
+ topic = `git config convore.topic`.chop!
8
+ if user.empty?
9
+ puts "Setting convore username (git config user.convore <username>)."
10
+ print "Enter username: "
11
+ user = gets.chomp
12
+ `git config user.convore #{user}`
13
+ end
14
+ if topic.empty?
15
+ raise "Fail. Set topic id number: git config convore.topic <topic_id>"
16
+ puts "Setting convore topic id number (git config convore.topic <id>)."
17
+ print "Enter topic id number: "
18
+ topic = gets.chomp
19
+ `git config convore.topic #{topic}`
20
+ end
8
21
  url = "https://convore.com/api/topics/#{topic}/messages/create.json"
9
22
  return `echo "#{message}" | curl -u "#{user}" -F message="<-" #{url}`
10
23
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Micha Niskin