wolfram 0.2.0 → 0.3.0

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
+ SHA256:
3
+ metadata.gz: fd3451b72b0a1f073559b55f69d43b46d640ae2e4a69fb0a16f849be198d989b
4
+ data.tar.gz: 860b59ec201e5e1785fda81ca357e7b5b04bf2b5a42b9c82f5fce8c71f0c8270
5
+ SHA512:
6
+ metadata.gz: e1ab57df86ccb0efaf888a18b1423d415fa350b8a62f1ee2857f7b37fb075f4d636a3795cb0365f5d27e46ad581c76496ad52d8289cfa1b793e808b59ea37942
7
+ data.tar.gz: '089a32af3c638620ce86dee780cdd6c58a1f1a7c03989fd027008c7a127e120fdc7e9e50a9be0986d269aca8039e0829c0af45a7e34372f55a2242dd1de7ab74'
data/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ ## 0.2.2
2
+
3
+ * Fix `Query.fetch` on Ruby 3+ ([#10](https://github.com/cldwalker/wolfram/pull/10))
4
+
5
+ ## 0.2.1
6
+ * Fix requery.fetch
7
+
8
+ ## 0.2.0
9
+ * Add HashPresenter class
10
+ * Update fixture
11
+
12
+ ## 0.1.2
13
+ * Fix constants bug
14
+
15
+ ## 0.1.1
16
+ * Fix requerying by state
17
+
18
+ ## 0.1.0
19
+ * Initial release
20
+
data/README.md CHANGED
@@ -3,7 +3,6 @@ Description
3
3
 
4
4
  Explore the vast world of computational knowledge available for free via Wolfram's v2 API.
5
5
 
6
-
7
6
  ### Install
8
7
 
9
8
  To install this gem:
@@ -12,6 +11,8 @@ To install this gem:
12
11
  gem install wolfram
13
12
  ```
14
13
 
14
+ Ruby 2.7 and later are supported; earlier versions may work, but are
15
+ not supported.
15
16
 
16
17
  ### Setup
17
18
 
@@ -31,7 +32,6 @@ If you want to explicitly set your appid in a script:
31
32
  Wolfram.appid = "YOURKEY"
32
33
  ```
33
34
 
34
-
35
35
  ### Usage
36
36
 
37
37
  Query away on the commandline!
@@ -53,18 +53,16 @@ Regular ruby usage:
53
53
  query = 'boston population'
54
54
  result = Wolfram.fetch(query)
55
55
  # to see the result as a hash of pods and assumptions:
56
- hash = HashPresenter.new(result).to_hash
56
+ hash = Wolfram::HashPresenter.new(result).to_hash
57
57
  ```
58
58
 
59
59
  For many more examples, [see here](http://www.wolframalpha.com/examples/).
60
60
 
61
-
62
61
  ## Credits
63
62
 
64
63
  * [Ian White](https://github.com/ianwhite) is the original author of this gem.
65
- * spaghetticode for HashPresenter
66
- * bdigital for a bug fix
67
-
64
+ * @spaghetticode for HashPresenter
65
+ * @bdigital, @emilesilvis for bug fixes
68
66
 
69
67
  ## Todo
70
68
 
@@ -53,7 +53,7 @@ module Wolfram
53
53
  end
54
54
 
55
55
  def requery
56
- Query.new(@query.input, @query.options.merge(:assumption => self))
56
+ Query.new(@query.input, @query.options.merge(:assumption => input))
57
57
  end
58
58
 
59
59
  def refetch
data/lib/wolfram/query.rb CHANGED
@@ -4,7 +4,7 @@ module Wolfram
4
4
  # When given an input, appid and other query params, creates a Result object
5
5
  class Query
6
6
  def self.fetch(uri)
7
- open(uri).read
7
+ URI.open(uri).read
8
8
  end
9
9
 
10
10
  attr_accessor :input, :options, :appid, :query_uri
@@ -1,3 +1,3 @@
1
1
  module Wolfram
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require 'rubygems' unless Object.const_defined?(:Gem)
3
- require File.dirname(__FILE__) + "/lib/wolfram/version"
2
+
3
+ require_relative "./lib/wolfram/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "wolfram"
@@ -10,15 +10,16 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "http://github.com/cldwalker/wolfram"
11
11
  s.summary = "Wolfram V2 API client"
12
12
  s.description = "Explore the vast world of computational knowledge available for free via Wolfram's v2 API."
13
- s.required_rubygems_version = ">= 1.3.6"
13
+ s.required_ruby_version = ">= 2.7"
14
14
  s.executables = ['wolfram']
15
- s.add_dependency 'nokogiri', '>= 1.4.3'
15
+ s.add_runtime_dependency "nokogiri", "~> 1", ">= 1.4.3"
16
16
  s.add_development_dependency 'rr'
17
17
  s.add_development_dependency 'bacon', '>= 1.1.0'
18
18
  s.add_development_dependency 'bacon-rr'
19
19
  s.add_development_dependency 'bacon-bits'
20
- s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
21
- s.files += Dir.glob(['test/fixtures/*.xml']) + %w{.travis.yml CONTRIBUTING.md}
20
+ s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,md} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile wolfram.gemspec}
21
+ s.files += Dir.glob(['test/fixtures/*.xml']) + %w{.travis.yml}
22
22
  s.extra_rdoc_files = ["README.md", "LICENSE.txt"]
23
23
  s.license = 'MIT'
24
+ s.metadata["rubygems_mfa_required"] = "true"
24
25
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolfram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gabriel Horner
@@ -10,86 +9,82 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-02-07 00:00:00.000000000 Z
12
+ date: 2023-08-06 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: nokogiri
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1'
21
+ - - ">="
21
22
  - !ruby/object:Gem::Version
22
23
  version: 1.4.3
23
24
  type: :runtime
24
25
  prerelease: false
25
26
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
27
  requirements:
28
- - - ! '>='
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '1'
31
+ - - ">="
29
32
  - !ruby/object:Gem::Version
30
33
  version: 1.4.3
31
34
  - !ruby/object:Gem::Dependency
32
35
  name: rr
33
36
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
37
  requirements:
36
- - - ! '>='
38
+ - - ">="
37
39
  - !ruby/object:Gem::Version
38
40
  version: '0'
39
41
  type: :development
40
42
  prerelease: false
41
43
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
44
  requirements:
44
- - - ! '>='
45
+ - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: bacon
49
50
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.1.0
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
58
  requirements:
60
- - - ! '>='
59
+ - - ">="
61
60
  - !ruby/object:Gem::Version
62
61
  version: 1.1.0
63
62
  - !ruby/object:Gem::Dependency
64
63
  name: bacon-rr
65
64
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
65
  requirements:
68
- - - ! '>='
66
+ - - ">="
69
67
  - !ruby/object:Gem::Version
70
68
  version: '0'
71
69
  type: :development
72
70
  prerelease: false
73
71
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
72
  requirements:
76
- - - ! '>='
73
+ - - ">="
77
74
  - !ruby/object:Gem::Version
78
75
  version: '0'
79
76
  - !ruby/object:Gem::Dependency
80
77
  name: bacon-bits
81
78
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
79
  requirements:
84
- - - ! '>='
80
+ - - ">="
85
81
  - !ruby/object:Gem::Version
86
82
  version: '0'
87
83
  type: :development
88
84
  prerelease: false
89
85
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
86
  requirements:
92
- - - ! '>='
87
+ - - ">="
93
88
  - !ruby/object:Gem::Version
94
89
  version: '0'
95
90
  description: Explore the vast world of computational knowledge available for free
@@ -102,6 +97,15 @@ extra_rdoc_files:
102
97
  - README.md
103
98
  - LICENSE.txt
104
99
  files:
100
+ - ".travis.yml"
101
+ - CHANGELOG.md
102
+ - CONTRIBUTING.md
103
+ - LICENSE.txt
104
+ - README.md
105
+ - Rakefile
106
+ - bin/wolfram
107
+ - deps.rip
108
+ - lib/wolfram.rb
105
109
  - lib/wolfram/assumption.rb
106
110
  - lib/wolfram/hash_presenter.rb
107
111
  - lib/wolfram/pod.rb
@@ -110,46 +114,35 @@ files:
110
114
  - lib/wolfram/util.rb
111
115
  - lib/wolfram/version.rb
112
116
  - lib/wolfram/xml_container.rb
113
- - lib/wolfram.rb
117
+ - test/deps.rip
118
+ - test/fixtures/boston.xml
114
119
  - test/hash_presenter_test.rb
115
120
  - test/test_helper.rb
116
121
  - test/util_test.rb
117
122
  - test/wolfram_test.rb
118
- - bin/wolfram
119
- - LICENSE.txt
120
- - CHANGELOG.rdoc
121
- - README.rdoc
122
- - deps.rip
123
- - test/deps.rip
124
- - Rakefile
125
- - .gemspec
126
- - test/fixtures/boston.xml
127
- - .travis.yml
128
- - CONTRIBUTING.md
129
- - README.md
123
+ - wolfram.gemspec
130
124
  homepage: http://github.com/cldwalker/wolfram
131
125
  licenses:
132
126
  - MIT
127
+ metadata:
128
+ rubygems_mfa_required: 'true'
133
129
  post_install_message:
134
130
  rdoc_options: []
135
131
  require_paths:
136
132
  - lib
137
133
  required_ruby_version: !ruby/object:Gem::Requirement
138
- none: false
139
134
  requirements:
140
- - - ! '>='
135
+ - - ">="
141
136
  - !ruby/object:Gem::Version
142
- version: '0'
137
+ version: '2.7'
143
138
  required_rubygems_version: !ruby/object:Gem::Requirement
144
- none: false
145
139
  requirements:
146
- - - ! '>='
140
+ - - ">="
147
141
  - !ruby/object:Gem::Version
148
- version: 1.3.6
142
+ version: '0'
149
143
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 1.8.24
144
+ rubygems_version: 3.4.10
152
145
  signing_key:
153
- specification_version: 3
146
+ specification_version: 4
154
147
  summary: Wolfram V2 API client
155
148
  test_files: []
data/CHANGELOG.rdoc DELETED
@@ -1,13 +0,0 @@
1
- == 0.2.0
2
- * Add HashPresenter class
3
- * Update fixture
4
-
5
- == 0.1.2
6
- * Fix constants bug
7
-
8
- == 0.1.1
9
- * Fix requerying by state
10
-
11
- == 0.1.0
12
- * Initial release
13
-
data/README.rdoc DELETED
@@ -1,50 +0,0 @@
1
- == Description
2
- Explore the vast world of computational knowledge available for free via Wolfram's v2 API.
3
-
4
- == Install
5
-
6
- To install this gem:
7
-
8
- gem install wolfram
9
-
10
- == Setup
11
-
12
- You'll need a Wolfram Appid (api key) by {creating an account
13
- here}[http://developer.wolframalpha.com/portal/apisignup.html] and
14
- then clicking on the 'Get an APPID' button.
15
-
16
- Once you have your own appid, set it in your shell, preferably in your ~/.bashrc:
17
-
18
- export WOLFRAM_APPID='YOURKEY'
19
-
20
- If you want to explicitly set your appid in a script:
21
-
22
- Wolfram.appid = "YOURKEY"
23
-
24
- == Usage
25
-
26
- Query away on the commandline!
27
-
28
- # Calculate distance and travel time between places
29
- $ wolfram from boston to new york
30
-
31
- # Solve an equation
32
- $ wolfram x^3 - 4x^2 + 6x - 24 = 0
33
-
34
- # Find words ending with able
35
- $ wolfram words ending with able
36
-
37
- For many more examples, {see here}[http://www.wolframalpha.com/examples/].
38
-
39
- == Credits
40
-
41
- * {Ian White}[https://github.com/ianwhite] is the original author of this gem.
42
- * bdigital for a bug fix
43
-
44
- == Contributing
45
- {See here}[http://tagaholic.me/contributing.html]
46
-
47
- == Todo
48
- * More tests!
49
- * A better inspect
50
- * Handle more api options including format