convore-simple 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/convore-simple.gemspec +1 -1
- data/lib/convore-simple.rb +15 -2
- metadata +2 -2
data/convore-simple.gemspec
CHANGED
data/lib/convore-simple.rb
CHANGED
@@ -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
|