tricorder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +51 -0
  3. data/LICENSE +21 -0
  4. data/README.md +61 -0
  5. data/bin/tricorder +50 -0
  6. data/lib/dsl/operators/.rb +0 -0
  7. data/lib/dsl/operators/base_operators.rb +260 -0
  8. data/lib/dsl/operators/string.rb +9 -0
  9. data/lib/dsl/operators/tricorders.rb +68 -0
  10. data/lib/dsl/operators/tricorders/animal.rb +19 -0
  11. data/lib/dsl/operators/tricorders/astronomical_object.rb +19 -0
  12. data/lib/dsl/operators/tricorders/book.rb +19 -0
  13. data/lib/dsl/operators/tricorders/book_collection.rb +19 -0
  14. data/lib/dsl/operators/tricorders/book_series.rb +19 -0
  15. data/lib/dsl/operators/tricorders/character.rb +19 -0
  16. data/lib/dsl/operators/tricorders/comic_collection.rb +19 -0
  17. data/lib/dsl/operators/tricorders/comic_series.rb +19 -0
  18. data/lib/dsl/operators/tricorders/comic_strip.rb +19 -0
  19. data/lib/dsl/operators/tricorders/comics.rb +19 -0
  20. data/lib/dsl/operators/tricorders/company.rb +19 -0
  21. data/lib/dsl/operators/tricorders/conflict.rb +19 -0
  22. data/lib/dsl/operators/tricorders/element.rb +19 -0
  23. data/lib/dsl/operators/tricorders/episode.rb +19 -0
  24. data/lib/dsl/operators/tricorders/food.rb +19 -0
  25. data/lib/dsl/operators/tricorders/literature.rb +19 -0
  26. data/lib/dsl/operators/tricorders/location.rb +19 -0
  27. data/lib/dsl/operators/tricorders/magazine.rb +19 -0
  28. data/lib/dsl/operators/tricorders/magazine_series.rb +19 -0
  29. data/lib/dsl/operators/tricorders/material.rb +19 -0
  30. data/lib/dsl/operators/tricorders/medical_condition.rb +19 -0
  31. data/lib/dsl/operators/tricorders/movie.rb +19 -0
  32. data/lib/dsl/operators/tricorders/occupation.rb +19 -0
  33. data/lib/dsl/operators/tricorders/organization.rb +19 -0
  34. data/lib/dsl/operators/tricorders/performer.rb +19 -0
  35. data/lib/dsl/operators/tricorders/season.rb +19 -0
  36. data/lib/dsl/operators/tricorders/series.rb +19 -0
  37. data/lib/dsl/operators/tricorders/soundtrack.rb +19 -0
  38. data/lib/dsl/operators/tricorders/spacecraft.rb +19 -0
  39. data/lib/dsl/operators/tricorders/spacecraft_class.rb +19 -0
  40. data/lib/dsl/operators/tricorders/species.rb +19 -0
  41. data/lib/dsl/operators/tricorders/staff.rb +19 -0
  42. data/lib/dsl/operators/tricorders/technology.rb +19 -0
  43. data/lib/dsl/operators/tricorders/title.rb +19 -0
  44. data/lib/dsl/operators/tricorders/trading_card.rb +19 -0
  45. data/lib/dsl/operators/tricorders/trading_card_deck.rb +19 -0
  46. data/lib/dsl/operators/tricorders/trading_card_set.rb +19 -0
  47. data/lib/dsl/operators/tricorders/video_game.rb +19 -0
  48. data/lib/dsl/operators/tricorders/video_release.rb +19 -0
  49. data/lib/dsl/operators/tricorders/weapon.rb +19 -0
  50. data/lib/dsl/tricorder.rb +10 -0
  51. data/lib/dsl/tricorder_dsl.rb +23 -0
  52. data/lib/tricorder.rb +18 -0
  53. data/lib/version.rb +9 -0
  54. data/tricorder.gemspec +35 -0
  55. metadata +169 -0
@@ -0,0 +1,10 @@
1
+ require_relative 'tricorder_dsl'
2
+ require_relative 'operators/string'
3
+
4
+ module Tricorder
5
+ BASE_URL = 'http://stapi.co/api/v1/rest'.freeze
6
+ def tricorder(&block)
7
+ tricorder = TricorderDSL.new
8
+ tricorder.instance_eval(&block) if block_given?
9
+ end
10
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'operators/base_operators'
2
+ require_relative 'tricorder'
3
+
4
+ class TricorderDSL < BaseOperators::BaseDSLOperators
5
+ include BaseOperators
6
+
7
+ def initialize
8
+ @error = false
9
+ @results = []
10
+ @search = []
11
+ @operations = {}
12
+ @page = 0
13
+ @verbose = true
14
+ @storedir = '/tmp'
15
+ @tricorder = nil
16
+ @info = {}
17
+ end
18
+
19
+ def method_missing(method, *args)
20
+ @operations[method] = args
21
+ self
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ # = A Domain-Specific Language for Star Trek API (http://stapi.co)
2
+ #
3
+ # Homepage:: http://github.com/jjuliano/tricorder
4
+ # Author:: Joel Bryan Juliano
5
+ # Copyright:: (cc) 2018 Joel Bryan Juliano
6
+ # License:: GNU LGPLv3
7
+ #
8
+ require 'rubygems'
9
+ require 'byebug'
10
+ require 'uri'
11
+ require 'net/http'
12
+ require 'awesome_print'
13
+ require 'json'
14
+ require 'pstore'
15
+
16
+ require_relative 'version'
17
+
18
+ Dir[File.join(File.dirname(__FILE__), '**/**/*.rb')].sort.reverse.each { |lib| require lib }
@@ -0,0 +1,9 @@
1
+ module Tricorder #:nodoc:
2
+ module VERSION #:nodoc:
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require_relative "lib/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "tricorder"
8
+ spec.version = Tricorder::VERSION::STRING
9
+ spec.authors = ["Joel Bryan Juliano"]
10
+ spec.email = ["joelbryan.juliano@gmail.com"]
11
+
12
+ spec.summary = %q{A Domain-Specific Language for Star Trek API (http://stapi.co)}
13
+ spec.description = %q{A Domain-Specific Language for Star Trek API (http://stapi.co)}
14
+ spec.homepage = "https://github.com/jjuliano/tricorder"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting "allowed_push_host", or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "bin"
27
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency "bundler"
31
+ spec.add_dependency "awesome_print"
32
+ spec.add_dependency "json"
33
+ spec.add_dependency "thor"
34
+ spec.add_development_dependency "byebug"
35
+ end
metadata ADDED
@@ -0,0 +1,169 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tricorder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Joel Bryan Juliano
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-02-24 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: '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: awesome_print
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: json
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: thor
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: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: A Domain-Specific Language for Star Trek API (http://stapi.co)
84
+ email:
85
+ - joelbryan.juliano@gmail.com
86
+ executables:
87
+ - tricorder
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - LICENSE
93
+ - README.md
94
+ - bin/tricorder
95
+ - lib/dsl/operators/.rb
96
+ - lib/dsl/operators/base_operators.rb
97
+ - lib/dsl/operators/string.rb
98
+ - lib/dsl/operators/tricorders.rb
99
+ - lib/dsl/operators/tricorders/animal.rb
100
+ - lib/dsl/operators/tricorders/astronomical_object.rb
101
+ - lib/dsl/operators/tricorders/book.rb
102
+ - lib/dsl/operators/tricorders/book_collection.rb
103
+ - lib/dsl/operators/tricorders/book_series.rb
104
+ - lib/dsl/operators/tricorders/character.rb
105
+ - lib/dsl/operators/tricorders/comic_collection.rb
106
+ - lib/dsl/operators/tricorders/comic_series.rb
107
+ - lib/dsl/operators/tricorders/comic_strip.rb
108
+ - lib/dsl/operators/tricorders/comics.rb
109
+ - lib/dsl/operators/tricorders/company.rb
110
+ - lib/dsl/operators/tricorders/conflict.rb
111
+ - lib/dsl/operators/tricorders/element.rb
112
+ - lib/dsl/operators/tricorders/episode.rb
113
+ - lib/dsl/operators/tricorders/food.rb
114
+ - lib/dsl/operators/tricorders/literature.rb
115
+ - lib/dsl/operators/tricorders/location.rb
116
+ - lib/dsl/operators/tricorders/magazine.rb
117
+ - lib/dsl/operators/tricorders/magazine_series.rb
118
+ - lib/dsl/operators/tricorders/material.rb
119
+ - lib/dsl/operators/tricorders/medical_condition.rb
120
+ - lib/dsl/operators/tricorders/movie.rb
121
+ - lib/dsl/operators/tricorders/occupation.rb
122
+ - lib/dsl/operators/tricorders/organization.rb
123
+ - lib/dsl/operators/tricorders/performer.rb
124
+ - lib/dsl/operators/tricorders/season.rb
125
+ - lib/dsl/operators/tricorders/series.rb
126
+ - lib/dsl/operators/tricorders/soundtrack.rb
127
+ - lib/dsl/operators/tricorders/spacecraft.rb
128
+ - lib/dsl/operators/tricorders/spacecraft_class.rb
129
+ - lib/dsl/operators/tricorders/species.rb
130
+ - lib/dsl/operators/tricorders/staff.rb
131
+ - lib/dsl/operators/tricorders/technology.rb
132
+ - lib/dsl/operators/tricorders/title.rb
133
+ - lib/dsl/operators/tricorders/trading_card.rb
134
+ - lib/dsl/operators/tricorders/trading_card_deck.rb
135
+ - lib/dsl/operators/tricorders/trading_card_set.rb
136
+ - lib/dsl/operators/tricorders/video_game.rb
137
+ - lib/dsl/operators/tricorders/video_release.rb
138
+ - lib/dsl/operators/tricorders/weapon.rb
139
+ - lib/dsl/tricorder.rb
140
+ - lib/dsl/tricorder_dsl.rb
141
+ - lib/tricorder.rb
142
+ - lib/version.rb
143
+ - tricorder.gemspec
144
+ homepage: https://github.com/jjuliano/tricorder
145
+ licenses:
146
+ - MIT
147
+ metadata:
148
+ allowed_push_host: https://rubygems.org
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubyforge_project:
165
+ rubygems_version: 2.7.3
166
+ signing_key:
167
+ specification_version: 4
168
+ summary: A Domain-Specific Language for Star Trek API (http://stapi.co)
169
+ test_files: []