ximobi 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+
19
+ *.swp
data/README.md CHANGED
@@ -1,24 +1,34 @@
1
1
  # Ximobi
2
2
 
3
- TODO: Write a gem description
3
+ A command line gem for logging time and expense entries into Ximobi
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ $ gem install ximobi
8
8
 
9
- gem 'ximobi'
9
+ ## Usage
10
10
 
11
- And then execute:
11
+ Start a time entry like this:
12
12
 
13
- $ bundle
13
+ $ ximobi time
14
14
 
15
- Or install it yourself as:
15
+ You will be prompted to enter your email
16
16
 
17
- $ gem install ximobi
17
+ $ Email: [your ximobi email]
18
+
19
+ Then you will be promptes to enter categories. Enter categories with a comma separated list:
20
+
21
+ $ Categories: One category, second category, third category
22
+
23
+ Then you will be prompted to enter the time:
24
+
25
+ $ Time: [hours or minutes]
26
+
27
+ Then you can enter a description:
28
+
29
+ $ Description:
18
30
 
19
- ## Usage
20
31
 
21
- TODO: Write usage instructions here
22
32
 
23
33
  ## Contributing
24
34
 
@@ -1,3 +1,3 @@
1
1
  module Ximobi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/ximobi.rb CHANGED
@@ -4,9 +4,11 @@ require "uri"
4
4
 
5
5
  module Ximobi
6
6
  class Entry
7
+ #YEAH YEAH, ITS A LOT OF DUPE BUT IM THE ONLY USER AND IM IN A HURRY SO DEAL WITH IT
7
8
  def time
8
9
  case ARGV[0].downcase
9
10
  when "time"
11
+ #TIME
10
12
  print "Email: "
11
13
  email = $stdin.gets.chomp
12
14
  print "Categories: "
@@ -26,12 +28,38 @@ module Ximobi
26
28
  "categories" => categories,
27
29
  "time" => "#{time}",
28
30
  "description" => "#{description}",
31
+ "type" => "time"
29
32
  })
30
33
 
31
34
  response = http.request(request)
35
+ puts Time.now
32
36
 
33
37
  when "expense"
34
- print "Expense entries not yet available for command line use \n"
38
+ #EXPENSE
39
+ print "Email: "
40
+ email = $stdin.gets.chomp
41
+ print "Categories: "
42
+ categories = $stdin.gets.chomp
43
+ #categories = categories.split(",")
44
+ print "Amount: "
45
+ amount = $stdin.gets.chomp
46
+ print "Description: "
47
+ description = $stdin.gets.chomp
48
+
49
+ #Post the data to the webservice
50
+ uri = URI.parse("http://ximobi.wyliethomas.com/capture/gem")
51
+ http = Net::HTTP.new(uri.host, uri.port)
52
+
53
+ request = Net::HTTP::Post.new(uri.request_uri)
54
+ request.set_form_data({"email" => "#{email}",
55
+ "categories" => categories,
56
+ "amount" => "#{amount}",
57
+ "description" => "#{description}",
58
+ "type" => "expense"
59
+ })
60
+
61
+ response = http.request(request)
62
+ puts Time.now
35
63
  end
36
64
 
37
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ximobi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-29 00:00:00.000000000 Z
12
+ date: 2014-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -56,10 +56,10 @@ files:
56
56
  - LICENSE.txt
57
57
  - README.md
58
58
  - Rakefile
59
+ - bin/ximobi
59
60
  - lib/ximobi.rb
60
61
  - lib/ximobi/version.rb
61
62
  - ximobi.gemspec
62
- - bin/ximobi
63
63
  homepage: ''
64
64
  licenses:
65
65
  - MIT