smart_alec 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a85b08f24e3c10c52139bcf60807f9c7a9237bbe
4
+ data.tar.gz: ee0bb3a257e264779db0043c92695171d3b82b97
5
+ SHA512:
6
+ metadata.gz: aca84312dc34a28c6e48eb5865265309e308209a56bb4b47145de1e47f02fd985d3e2b3107f403ef37c39a2fabbfd3158f49f563bc0b707b2ab9a0989f672f99
7
+ data.tar.gz: 92f892bb510b3f6fde04de10abe420ae49ad196a7c7b5c9c383cab5478e40d87466ec32be5ce810ce54ac86ad159d5174d26be2ebb914f43b1fe5c57f093172a
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in smart_alec.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Jay Wengrow
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # SmartAlec
2
+
3
+ Smart Alec is a robot that runs from your terminal and can do all sorts of tasks and get you quick information when you need it.
4
+
5
+ ## Installation
6
+
7
+ Install in your terminal with:
8
+
9
+ $ gem install smart_alec
10
+
11
+ ## Usage
12
+
13
+ To get the current date and time:
14
+
15
+ $ alec time
16
+
17
+ To get a realtime stock quote:
18
+
19
+ $ alec stock STOCK_SYMBOL
20
+
21
+ To get the current weather for a city:
22
+
23
+ $ alec weather CITY
24
+
25
+ Many more functionalities coming soon!
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/[my-github-username]/smart_alec/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/alec ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'open_weather'
4
+ require 'stock_quote'
5
+
6
+ command = ARGV[0]
7
+ option = ARGV[1]
8
+
9
+ if command == "time"
10
+ puts "The date and time currently is: " + Time.now.strftime("%A, %B %d %Y %l:%M %p")
11
+ elsif command == "weather"
12
+ weather_info = OpenWeather::Current.city(option)
13
+ temp = ((weather_info["main"]["temp"].to_f - 273.15) * 1.8 + 32).round(2)
14
+ puts "The current temperature in #{option} is #{temp}."
15
+ elsif command == "stock"
16
+ bid = StockQuote::Stock.quote(option).bid_realtime
17
+ puts "The realtime bid for #{option.upcase} is $#{bid}."
18
+ else
19
+ puts "Alec doesn't understand that command."
20
+ end
@@ -0,0 +1,3 @@
1
+ module SmartAlec
2
+ VERSION = "0.0.1"
3
+ end
data/lib/smart_alec.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "smart_alec/version"
2
+
3
+ module SmartAlec
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'smart_alec/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "smart_alec"
8
+ spec.version = SmartAlec::VERSION
9
+ spec.authors = ["Jay Wengrow"]
10
+ spec.email = ["jaywngrw@gmail.com"]
11
+ spec.summary = %q{Use the alec command in your terminal to get all sorts of quick information.}
12
+ spec.description = %q{Smart Alec is a robot that runs from your terminal and can do all sorts of tasks and get you quick information when you need it.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_dependency "open-weather"
25
+ spec.add_dependency "stock_quote"
26
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smart_alec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jay Wengrow
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: open-weather
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: stock_quote
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Smart Alec is a robot that runs from your terminal and can do all sorts
70
+ of tasks and get you quick information when you need it.
71
+ email:
72
+ - jaywngrw@gmail.com
73
+ executables:
74
+ - alec
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/alec
84
+ - lib/smart_alec.rb
85
+ - lib/smart_alec/version.rb
86
+ - smart_alec.gemspec
87
+ homepage: ''
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.2.2
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Use the alec command in your terminal to get all sorts of quick information.
111
+ test_files: []