eph_jcg 0.1.1 → 0.1.2

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: ca8e150233d78b19ea6fc2706782324512f4acf3
4
- data.tar.gz: ccd149b2df6b67807d6b1a72d6042119d295a175
3
+ metadata.gz: 0d0d3abaec3a478f18a1c377b11d18c24af32f44
4
+ data.tar.gz: 9ac0bd5ec72d81bc7dfcd2c649aae10e6b2c3019
5
5
  SHA512:
6
- metadata.gz: 38f7fda3e928e3d591fc309f45351b4063f62f9200194aaf47e16dd7bf1c49ffd2f4bdbcdb00fcafd908f251b0c657b123890371de43b4c2675289dbb3665be6
7
- data.tar.gz: b72b76257e957ca34729e20d78cd5955f1f1063fff8848ba02e3721b658e6ca881026a64653151a3ed2e73aba4f49beb51704fc0a819ee513dd7c4b9c12f9acd
6
+ metadata.gz: c8162c56db889a68748f13e7e50bdefda123c6602f62df713a4068619b2c54bd0d9d5414670331fbf242659e36eb575b2f877c5e27c4da9798f75f6cbd828f59
7
+ data.tar.gz: 33b98b4f69bf65396254fa9d408c0160a5a9c4c0a6ac72d5192aea464f8ab96ab02ef7a99575f6b2a013876487056970f5ffb14317667923d97ac4f9a852519f
data/README.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # EphJcg
2
2
 
3
+ ## Introduction
4
+
5
+ This is the gem library which calculates ephemeris datas by JCG(Japan Coast Guard) method.
6
+
7
+ ### Computable imtes
8
+
9
+ * Sun
10
+ - R.A.(= Right Ascension, Alpha)
11
+ - Dec.(= Declination, Delta)
12
+ - Dist.(= Distance)
13
+ - h(= Greenwich hour angle)
14
+ - S.D.(= Apparent Semidiameter)
15
+ - Lambda(= Ecliptic longitude)
16
+ - Beta(= Ecliptic latitude)
17
+ * Moon
18
+ - R.A.(= Right Ascension, Alpha)
19
+ - Dec.(= Declination, Delta)
20
+ - H.P.(= Horizontal Parallax)
21
+ - h(= Greenwich hour angle)
22
+ - S.D.(= Apparent Semidiameter)
23
+ - Lambda(= Ecliptic longitude)
24
+ - Beta(= Ecliptic latitude)
25
+ * R
26
+ * Epsilon(= Mean obliquity of the ecliptic)
27
+ * Lambda difference between Sun and Moon
28
+
3
29
  ## Installation
4
30
 
5
31
  Add this line to your application's Gemfile:
data/exe/eph_jcg CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "eph_jcg"
4
4
 
5
- e = EphJcg.new(ARGV)
5
+ e = EphJcg.new(ARGV[0])
6
6
  exit unless e
7
7
  p e.jst, e.utc
8
8
  e.calc_all
@@ -1,7 +1,7 @@
1
1
  module EphJcg
2
2
  class Argument
3
- def initialize(args)
4
- @arg = args.shift
3
+ def initialize(arg)
4
+ @arg = arg
5
5
  end
6
6
 
7
7
  #=========================================================================
@@ -13,12 +13,6 @@ module EphJcg
13
13
  # @return: jst (UNIX time)
14
14
  #=========================================================================
15
15
  def get_jst
16
- unless @arg
17
- now = Time.now
18
- return Time.new(
19
- now.year, now.month, now.day, now.hour, now.min, now.sec
20
- ).to_f
21
- end
22
16
  (puts MSG_ERR_1; return 0) unless @arg =~ /^\d{8}$|^\d{14}$/
23
17
  year, month, day = @arg[ 0, 4].to_i, @arg[ 4, 2].to_i, @arg[ 6, 2].to_i
24
18
  hour, min, sec = @arg[ 8, 2].to_i, @arg[10, 2].to_i, @arg[12, 2].to_i
@@ -1,3 +1,3 @@
1
1
  module EphJcg
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/eph_jcg.rb CHANGED
@@ -7,8 +7,9 @@ require "eph_jcg/ephemeris"
7
7
  require "eph_jcg/time_calculator"
8
8
 
9
9
  module EphJcg
10
- def self.new(args = ARGV)
11
- jst = EphJcg::Argument.new(args).get_jst
10
+ def self.new(arg = ARGV[0])
11
+ arg ||= Time.now.strftime("%Y%m%d")
12
+ jst = EphJcg::Argument.new(arg).get_jst
12
13
  return if jst == 0
13
14
  return EphJcg::Ephemeris.new(jst)
14
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eph_jcg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - komasaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-05 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler