calc_sun 0.1.1 → 1.2.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29357270031ecabae17fb6934c30a86b3aa49e6b
4
- data.tar.gz: 9b95397a0a518191709c2ff26019e756c95eafdf
3
+ metadata.gz: 7696f373dcfc25f8a84ef4f3e579f3061ddb9bb5
4
+ data.tar.gz: 860b44844bb0ab3696f2a3d23692674ce036df52
5
5
  SHA512:
6
- metadata.gz: c0e3bf0a00afd5b82de2ee91a342109ddaf64634907ac27d078be1b758a9e37d1f818fe04cb79adaff9a30b7ed201eddacfe3d96b1fe6be6d3e382a3fe9256f8
7
- data.tar.gz: f337cbfd61716c4b273a1143c08598a3be4b5f3f58e3dd87f7c2a0ba513a067e5b8674081a8c595b13b582cf0388c41720b1dc59a2fe304340b2d1c7f3d5b422
6
+ metadata.gz: d4ede90b8ca8a773204fabd880240e3f9130195ddfd967ee049e8fe2e79c5d4f9bfe7a4f36bfb77f29151c40c682f0abffa1df17e65ca2fb1d836aac5a84fa29
7
+ data.tar.gz: 7bbeef9326ffbd8a2e4288441af201c63553d21b1feeb03f19866181ed2f4fd8dfdf3c88115e1a01cead7a4d089406361b31dd2f063921a3b95cdf01d024537f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.autotest ADDED
@@ -0,0 +1,15 @@
1
+ # -*- ruby -*-
2
+
3
+ require "autotest/restart"
4
+
5
+ Autotest.add_hook :initialize do |at|
6
+
7
+ at.add_mapping(/.*\.c/) do |f, _|
8
+ at.files_matching(/_test.*rb$/)
9
+ end
10
+
11
+ end
12
+
13
+ Autotest.add_hook :run_command do |at|
14
+ system "rake clean compile"
15
+ end
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /rdoc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ InstalledFiles
12
+ lib/calc_sun/calc_sun.so
data/.source_index ADDED
Binary file
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.6
5
+ before_install: gem install bundler -v 1.13.7
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at kb9agt@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,30 +1,21 @@
1
- source 'https://rubygems.org'
1
+ # -*- ruby -*-
2
2
 
3
- gemspec
3
+ # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
4
 
5
- group :development, :test do
6
- gem 'hoe'
7
- gem 'rake-compiler', '~> 0.9.3'
8
- gem 'mustache'
9
- gem 'rubocop'
10
- gem 'development'
11
- gem 'thor'
12
- gem 'guard'
13
- gem 'guard-rspec', require: false
14
- gem 'minitest'
15
- gem 'guard-minitest'
16
- gem 'ZenTest'
17
- gem 'rspec'
18
- gem 'yard'
19
- gem 'rdoc'
20
- gem 'ffi'
21
- gem 'simplecov'
22
- gem 'test-unit'
23
- gem 'shoulda'
24
- gem 'pry'
25
- gem 'guard-pytest'
26
- gem 'nenv'
27
- gem 'lumberjack'
28
- gem 'listen'
29
- gem 'ruby_dep', '~> 1.2.0'
30
- end
5
+ source 'https://rubygems.org/'
6
+
7
+ gem 'hoe', '~>3.12', group: [:development, :test]
8
+ gem 'hoe-bundler'
9
+ gem 'hoe-debugging'
10
+ gem 'hoe-gemspec'
11
+ gem 'hoe-git'
12
+ gem 'minitest'
13
+ gem 'rake'
14
+ gem 'rake-compiler', '~>0.9.2', group: [:development, :test]
15
+ gem 'rake-compiler-dock', '~>0.5.1', group: [:development, :test]
16
+ gem 'rdoc', '~>4.0', group: [:development, :test]
17
+ gem 'rspec', group: [:development, :test]
18
+ gem 'test-unit', group: [:development, :test]
19
+ gem 'yard', group: [:development, :test]
20
+
21
+ # vim: syntax=ruby
data/Guardfile ADDED
@@ -0,0 +1,41 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :minitest do
5
+ # with Minitest::Unit
6
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
7
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
8
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
9
+
10
+ # with Minitest::Spec
11
+ # watch(%r{^spec/(.*)_spec\.rb$})
12
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
13
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
14
+
15
+ end
16
+
17
+ guard :minitest do
18
+ # with Minitest::Unit
19
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
20
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
21
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
22
+
23
+ # with Minitest::Spec
24
+ # watch(%r{^spec/(.*)_spec\.rb$})
25
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
26
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
27
+
28
+ # Rails 4
29
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
30
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
31
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
32
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
33
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
34
+ # watch(%r{^test/.+_test\.rb$})
35
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
36
+
37
+ # Rails < 4
38
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
39
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
40
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
41
+ end
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Douglas Allen
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Douglas Allen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Manifest.txt CHANGED
@@ -1,13 +1,29 @@
1
+ .autotest
2
+ .gitignore
3
+ .source_index
4
+ .travis.yml
5
+ CODE_OF_CONDUCT.md
6
+ Gemfile
7
+ Guardfile
1
8
  History.rdoc
2
9
  LICENSE.txt
3
10
  Manifest.txt
4
11
  Rakefile
5
- README.rdoc
6
12
  calc_sun.gemspec
13
+ calc_sun.md
14
+ calc_sun.pdf
15
+ dev.md
16
+ example/adt_helper.rb
17
+ example/askgeo_query.rb
18
+ example/sunriset.c
19
+ example/sunriset.rb
7
20
  ext/calc_sun/calc_sun.c
8
21
  ext/calc_sun/extconf.rb
22
+ ext/side_time/extconf.rb
23
+ ext/side_time/side_time.c
9
24
  lib/calc_sun.rb
10
25
  lib/calc_sun/version.rb
11
- test/calc_sun_test.rb
12
- example/sunriset.rb
13
- Gemfile
26
+ lib/side_time/version.rb
27
+ lib/sidereal_time.rb
28
+ test/calc_sun/test_calc_sun.rb
29
+ test/side_time/test_sidereal_time.rb
data/README.rdoc CHANGED
@@ -1,69 +1,77 @@
1
-
2
1
  = calc_sun
3
2
 
3
+ {<img src="https://travis-ci.org/DouglasAllen/calc_sun.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/DouglasAllen/calc_sun]
4
+
5
+
4
6
  Home :: https://rubygems.org/gems/calc_sun
5
7
  Code :: https://github.com/DouglasAllen/calc_sun
6
- RDoc :: http://http://www.rubydoc.info/gems/calc_sun/
8
+ RDoc :: http://www.rubydoc.info/gems/calc_sun/0.1.1
7
9
  Issues :: https://github.com/DouglasAllen/calc_sun/issues
8
10
 
9
11
 
10
- == DESCRIPTION:
12
+ === DESCRIPTION:
11
13
 
12
- Calculate Sunrise and Sunset. Now uses native C extension.
13
- An example is supplied to show gem usage.
14
+ Calculate Sunrise, Noon, and Sunset using native C extension.
15
+ An example is supplied to show this gem usage.
14
16
 
15
- == FEATURES/PROBLEMS:
17
+ === INSTALL: Note: older version
16
18
 
17
- n/a
19
+ $> gem install calc_sun
18
20
 
19
- == SYNOPSIS:
21
+ === DOWNLOAD:
20
22
 
21
- === start irb
23
+ $> git clone https://github.com/DouglasAllen/calc_sun.git
24
+ $> cd calc_sun
25
+ $> bundle install
22
26
 
23
- $ irb --simple-prompt
27
+ === Build with DEVKIT
24
28
 
25
- === enter Code
29
+ cd to devkit dir and run devkitvars.bat
30
+ or make a batchfile to start your envirnment with 'run devkitvars'
31
+ cd to calc_sun dir
32
+ $> gem build calc_sun.gemspec
33
+ $> gem install calc_sun-1.2.6.gem -l
26
34
 
27
- require 'calc_sun'
28
- cs = CalcSun.new
29
- require 'date'
30
- # not included yet for determining your mean time
31
- DJ00 = DateTime.parse('2000-01-01T12:00:00').jd
35
+ === DEVELOPERS:
32
36
 
33
- lat = 51.4770228
34
- lon = -0.0001147
35
- day = Date.parse('2016-12-25')
36
- jd = day.jd - DJ00 - lon / 360.0
37
- cs.t_rise(jd, lon, lat)
38
- cs.t_mid_day(jd, lon, lat)
39
- cs.t_set(jd, lon, lat)require 'date'
37
+ After checking out the source, run:
38
+
39
+ $ bundle exec rake newb
40
40
 
41
+ This task will install any missing dependencies, run the tests/specs,
42
+ and generate the RDoc.
41
43
 
42
- == INSTALL:
44
+ === FEATURES/PROBLEMS:
43
45
 
44
- $> bundle install
46
+ Consult issues if you want features or create pull requests.
45
47
 
46
- $> bundle exec rake install
48
+ === SYNOPSIS:
47
49
 
50
+ ==== start irb
48
51
 
49
- === Build with DEVKIT
52
+ $ irb --simple-prompt
50
53
 
51
- cd to devkit dir and run devkitvars.bat
54
+ ==== enter Code
52
55
 
53
- or make a batchfile to start your envirnment with 'run devkitvars'
54
- cd to calc_sun dir
55
- Rake -T
56
+ lat = 39.742476
57
+ lon = -105.1786
56
58
 
57
- == DEVELOPERS:
59
+ require 'calc_sun'
60
+ cs = CalcSun.new
58
61
 
59
- After checking out the source, run:
62
+ # require 'date' included in CalcSun class
63
+ ajd = DateTime.new(2003, 10, 17, 12, 30, 30).ajd.to_f
64
+ puts cs.ajd2dt(ajd)
60
65
 
61
- $ bundle exec rake newb
66
+ # set the date with set_date as date is just an ivar
67
+ day = cs.set_datetime('2003-10-17 12:30:30')
68
+ puts day
62
69
 
63
- This task will install any missing dependencies, run the tests/specs,
64
- and generate the RDoc.
70
+ puts "Sun rise: #{cs.rise(day.ajd, lat, lon).httpdate}"
71
+ puts "Sun noon: #{cs.noon(day.ajd, lat, lon).httpdate}"
72
+ puts "Sun set: #{cs.set(day.ajd, lat, lon).httpdate}"
65
73
 
66
- == LICENSE:
74
+ === LICENSE:
67
75
 
68
76
  (The MIT License)
69
77
 
data/Rakefile CHANGED
@@ -1,24 +1,89 @@
1
- #!/usr/bin/env ruby
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts 'Run `bundle install` to install missing gems'
10
+ exit e.status_code
11
+ end
12
+ require 'bundler/gem_tasks'
2
13
 
3
14
  require 'hoe'
4
- require 'rake/testtask'
15
+
16
+ require 'rake'
17
+ require 'rake/clean'
5
18
  require 'rake/extensiontask'
19
+ require 'rake/testtask'
20
+ require 'rake/win32'
21
+ require 'rdoc/task'
22
+ require 'rspec/core/rake_task'
23
+ require 'yard'
6
24
 
25
+ require 'rbconfig'
26
+ include RbConfig
7
27
 
8
- Hoe.plugin :manifest
28
+ # Hoe.plugins.delete :newb
29
+ # Hoe.plugins.delete :test
30
+ # Hoe.plugins.delete :signing
31
+ # Hoe.plugins.delete :publish
32
+ # Hoe.plugins.delete :clean
33
+ # Hoe.plugins.delete :package
34
+ # Hoe.plugins.delete :compiler
35
+ # Hoe.plugins.delete :debug
36
+ # Hoe.plugins.delete :rcov
37
+ # Hoe.plugins.delete :gemcutter
38
+ # Hoe.plugins.delete :racc
39
+ # Hoe.plugins.delete :inline
40
+ # Hoe.plugins.delete :gem_prelude_sucks
41
+ # Hoe.plugins.delete :flog
42
+ # Hoe.plugins.delete :flay
43
+ # Hoe.plugins.delete :deps
44
+ # Hoe.plugins.delete :minitest
45
+ # Hoe.plugins.delete :rdoc
46
+ # Hoe.plugins.delete :travis
47
+
48
+ # Hoe.plugin :newb
49
+ # Hoe.plugin :test
50
+ # Hoe.plugin :signing
51
+ # Hoe.plugin :publish
52
+ # Hoe.plugin :clean
53
+ # Hoe.plugin :package
54
+ # Hoe.plugin :compiler
55
+ # Hoe.plugin :debug
56
+ # Hoe.plugin :rcov
57
+ # Hoe.plugin :gemcutter
58
+ # Hoe.plugin :racc
59
+ # Hoe.plugin :inline
60
+ # Hoe.plugin :gem_prelude_sucks
61
+ # Hoe.plugin :flog
62
+ # Hoe.plugin :flay
63
+ # Hoe.plugin :deps
64
+ Hoe.plugin :minitest
65
+ # Hoe.plugin :rdoc
66
+ Hoe.plugin :travis
9
67
 
10
68
  Hoe.spec 'calc_sun' do
11
- self.version = '0.1.1'
12
- developer('kb9agt', 'kb9agt@gmail.com')
69
+ developer('Douglas Allen', 'kb9agt@gmail.com')
70
+ license('MIT')
13
71
  self.readme_file = 'README.rdoc'
14
- self.history_file = 'HISTORY.rdoc'
15
-
16
- extra_dev_deps << ['rake-compiler', '~> 0.9.3']
17
- self.spec_extras = { extensions: ['ext/calc_sun/extconf.rb'] }
18
-
72
+ self.history_file = 'History.rdoc'
73
+ self.version = '1.2.6'
74
+ self.extra_dev_deps += [
75
+ ['rake-compiler', '~> 0.9.2'],
76
+ ['rake-compiler-dock', '~> 0.5.1']
77
+ ]
78
+ self.spec_extras = { extensions: ['ext/calc_sun/extconf.rb',
79
+ 'ext/side_time/extconf.rb'] }
19
80
  Rake::ExtensionTask.new('calc_sun', spec) do |ext|
20
81
  ext.lib_dir = File.join('lib', 'calc_sun')
21
82
  end
83
+
84
+ Rake::ExtensionTask.new('side_time', spec) do |ext|
85
+ ext.lib_dir = File.join('lib', 'side_time')
86
+ end
22
87
  end
23
88
 
24
89
  Rake::Task[:test].prerequisites << :compile
@@ -27,7 +92,7 @@ Rake::Task[:test].prerequisites << :compile
27
92
  Rake::TestTask.new(:test) do |t|
28
93
  t.libs << 'test'
29
94
  t.libs << 'lib'
30
- t.test_files = FileList['test/*_test.rb']
95
+ t.test_files = FileList['test/calc_sun/test_*.rb', 'test/side_time/test_*.rb']
31
96
  end
32
97
 
33
98
  task default: :test