galileo 0.1.0

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.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +33 -0
  6. data/Rakefile +1 -0
  7. data/bin/galileo +9 -0
  8. data/galileo.gemspec +29 -0
  9. data/lib/galileo/version.rb +3 -0
  10. data/lib/galileo.rb +136 -0
  11. data/lib/terminal-table/.DS_Store +0 -0
  12. data/lib/terminal-table/Gemfile +7 -0
  13. data/lib/terminal-table/History.rdoc +48 -0
  14. data/lib/terminal-table/Manifest +24 -0
  15. data/lib/terminal-table/README.rdoc +240 -0
  16. data/lib/terminal-table/Rakefile +15 -0
  17. data/lib/terminal-table/Todo.rdoc +14 -0
  18. data/lib/terminal-table/examples/examples.rb +83 -0
  19. data/lib/terminal-table/lib/terminal-table/cell.rb +98 -0
  20. data/lib/terminal-table/lib/terminal-table/core_ext.rb +8 -0
  21. data/lib/terminal-table/lib/terminal-table/row.rb +53 -0
  22. data/lib/terminal-table/lib/terminal-table/separator.rb +14 -0
  23. data/lib/terminal-table/lib/terminal-table/style.rb +65 -0
  24. data/lib/terminal-table/lib/terminal-table/table.rb +261 -0
  25. data/lib/terminal-table/lib/terminal-table/table_helper.rb +9 -0
  26. data/lib/terminal-table/lib/terminal-table/version.rb +5 -0
  27. data/lib/terminal-table/lib/terminal-table.rb +13 -0
  28. data/lib/terminal-table/spec/cell_spec.rb +60 -0
  29. data/lib/terminal-table/spec/core_ext_spec.rb +18 -0
  30. data/lib/terminal-table/spec/import_spec.rb +11 -0
  31. data/lib/terminal-table/spec/row_spec.rb +25 -0
  32. data/lib/terminal-table/spec/spec.opts +1 -0
  33. data/lib/terminal-table/spec/spec_helper.rb +8 -0
  34. data/lib/terminal-table/spec/table_spec.rb +544 -0
  35. data/lib/terminal-table/tasks/docs.rake +13 -0
  36. data/lib/terminal-table/tasks/gemspec.rake +3 -0
  37. data/lib/terminal-table/tasks/spec.rake +25 -0
  38. data/lib/terminal-table/terminal-table.gemspec +30 -0
  39. data/lib/time/time-ago-in-words.rb +32 -0
  40. metadata +181 -0
@@ -0,0 +1,32 @@
1
+ class Time
2
+ module Units
3
+ Second = 1
4
+ Minute = Second * 60
5
+ Hour = Minute * 60
6
+ Day = Hour * 24
7
+ Week = Day * 7
8
+ Month = Week * 4
9
+ Year = Day * 365
10
+ Decade = Year * 10
11
+ Century = Decade * 10
12
+ Millennium = Century * 10
13
+ Eon = 1.0/0
14
+ end
15
+
16
+ def time_ago_in_words
17
+ time_difference = Time.now.to_i - self.to_i
18
+ unit = get_unit(time_difference)
19
+ unit_difference = time_difference / Units.const_get(unit.capitalize)
20
+
21
+ unit = unit.to_s.downcase + ('s' if time_difference > 1)
22
+
23
+ "#{unit_difference} #{unit} ago"
24
+ end
25
+
26
+ private
27
+ def get_unit(time_difference)
28
+ Units.constants.each_cons(2) do |con|
29
+ return con.first if (Units.const_get(con[0])...Units.const_get(con[1])) === time_difference
30
+ end
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,181 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: galileo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jackson Gariety
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: octokit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: colorize
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
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: netrc
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: api_cache
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
+ - !ruby/object:Gem::Dependency
70
+ name: moneta
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.5'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Search starred GitHub repos.
112
+ email:
113
+ - personal@jacksongariety.com
114
+ executables:
115
+ - galileo
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - .gitignore
120
+ - Gemfile
121
+ - LICENSE.txt
122
+ - README.md
123
+ - Rakefile
124
+ - bin/galileo
125
+ - galileo.gemspec
126
+ - lib/galileo.rb
127
+ - lib/galileo/version.rb
128
+ - lib/terminal-table/.DS_Store
129
+ - lib/terminal-table/Gemfile
130
+ - lib/terminal-table/History.rdoc
131
+ - lib/terminal-table/Manifest
132
+ - lib/terminal-table/README.rdoc
133
+ - lib/terminal-table/Rakefile
134
+ - lib/terminal-table/Todo.rdoc
135
+ - lib/terminal-table/examples/examples.rb
136
+ - lib/terminal-table/lib/terminal-table.rb
137
+ - lib/terminal-table/lib/terminal-table/cell.rb
138
+ - lib/terminal-table/lib/terminal-table/core_ext.rb
139
+ - lib/terminal-table/lib/terminal-table/row.rb
140
+ - lib/terminal-table/lib/terminal-table/separator.rb
141
+ - lib/terminal-table/lib/terminal-table/style.rb
142
+ - lib/terminal-table/lib/terminal-table/table.rb
143
+ - lib/terminal-table/lib/terminal-table/table_helper.rb
144
+ - lib/terminal-table/lib/terminal-table/version.rb
145
+ - lib/terminal-table/spec/cell_spec.rb
146
+ - lib/terminal-table/spec/core_ext_spec.rb
147
+ - lib/terminal-table/spec/import_spec.rb
148
+ - lib/terminal-table/spec/row_spec.rb
149
+ - lib/terminal-table/spec/spec.opts
150
+ - lib/terminal-table/spec/spec_helper.rb
151
+ - lib/terminal-table/spec/table_spec.rb
152
+ - lib/terminal-table/tasks/docs.rake
153
+ - lib/terminal-table/tasks/gemspec.rake
154
+ - lib/terminal-table/tasks/spec.rake
155
+ - lib/terminal-table/terminal-table.gemspec
156
+ - lib/time/time-ago-in-words.rb
157
+ homepage: http://jacksongariety.github.io/galileo
158
+ licenses:
159
+ - MIT
160
+ metadata: {}
161
+ post_install_message:
162
+ rdoc_options: []
163
+ require_paths:
164
+ - lib
165
+ required_ruby_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ requirements: []
176
+ rubyforge_project:
177
+ rubygems_version: 2.1.11
178
+ signing_key:
179
+ specification_version: 4
180
+ summary: Search your starred GitHub repos from the command line.
181
+ test_files: []