mk_cal_jpl 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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +9 -0
- data/Guardfile +70 -0
- data/LICENSE.txt +21 -0
- data/README.md +107 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/mk_cal_jpl +34 -0
- data/lib/mk_cal_jpl.rb +14 -0
- data/lib/mk_cal_jpl/argument.rb +44 -0
- data/lib/mk_cal_jpl/calendar.rb +87 -0
- data/lib/mk_cal_jpl/compute.rb +746 -0
- data/lib/mk_cal_jpl/const.rb +61 -0
- data/lib/mk_cal_jpl/version.rb +3 -0
- data/mk_cal_jpl.gemspec +35 -0
- metadata +134 -0
| @@ -0,0 +1,61 @@ | |
| 1 | 
            +
            module MkCalJpl
         | 
| 2 | 
            +
              module Const
         | 
| 3 | 
            +
                USAGE     = %Q{[USAGE] `MkCalJpl.new("<JPL_BIN_PATH>"[, "YYYYMMDD"])`}
         | 
| 4 | 
            +
                MSG_ERR_1 = "[ERROR] Binary file could not be found!"
         | 
| 5 | 
            +
                MSG_ERR_2 = "[ERROR] Date format should be `YYYYMMDD`!"
         | 
| 6 | 
            +
                MSG_ERR_3 = "[ERROR] Date is invalid!"
         | 
| 7 | 
            +
                JST_D     = 0.375  # = 9.0 / 24.0
         | 
| 8 | 
            +
                TT_TAI    = 32.184
         | 
| 9 | 
            +
                YOBI   = ["日", "月", "火", "水", "木", "金", "土"]
         | 
| 10 | 
            +
                ROKUYO = ["大安", "赤口", "先勝", "友引", "先負", "仏滅"]
         | 
| 11 | 
            +
                KANSHI = [
         | 
| 12 | 
            +
                  "甲子", "乙丑", "丙寅", "丁卯", "戊辰", "己巳", "庚午", "辛未", "壬申", "癸酉",
         | 
| 13 | 
            +
                  "甲戌", "乙亥", "丙子", "丁丑", "戊寅", "己卯", "庚辰", "辛巳", "壬午", "癸未",
         | 
| 14 | 
            +
                  "甲申", "乙酉", "丙戌", "丁亥", "戊子", "己丑", "庚寅", "辛卯", "壬辰", "癸巳",
         | 
| 15 | 
            +
                  "甲午", "乙未", "丙申", "丁酉", "戊戌", "己亥", "庚子", "辛丑", "壬寅", "癸卯",
         | 
| 16 | 
            +
                  "甲辰", "乙巳", "丙午", "丁未", "戊申", "己酉", "庚戌", "辛亥", "壬子", "癸丑",
         | 
| 17 | 
            +
                  "甲寅", "乙卯", "丙辰", "丁巳", "戊午", "己未", "庚申", "辛酉", "壬戌", "癸亥"
         | 
| 18 | 
            +
                ]
         | 
| 19 | 
            +
                SEKKI_24 = [
         | 
| 20 | 
            +
                  "春分", "清明", "穀雨", "立夏", "小満", "芒種",
         | 
| 21 | 
            +
                  "夏至", "小暑", "大暑", "立秋", "処暑", "白露",
         | 
| 22 | 
            +
                  "秋分", "寒露", "霜降", "立冬", "小雪", "大雪",
         | 
| 23 | 
            +
                  "冬至", "小寒", "大寒", "立春", "雨水", "啓蟄"
         | 
| 24 | 
            +
                ]
         | 
| 25 | 
            +
                SEKKU = [
         | 
| 26 | 
            +
                  [0, 1, 7, "人日"],
         | 
| 27 | 
            +
                  [1, 3, 3, "上巳"],
         | 
| 28 | 
            +
                  [2, 5, 5, "端午"],
         | 
| 29 | 
            +
                  [3, 7, 7, "七夕"],
         | 
| 30 | 
            +
                  [4, 9, 9, "重陽"]
         | 
| 31 | 
            +
                ]
         | 
| 32 | 
            +
                ZASSETSU = [
         | 
| 33 | 
            +
                  "節分"      , "彼岸入(春)", "彼岸(春)"  , "彼岸明(春)",
         | 
| 34 | 
            +
                  "社日(春)"  , "土用入(春)", "八十八夜"  , "入梅"      ,
         | 
| 35 | 
            +
                  "半夏生"    , "土用入(夏)", "二百十日"  , "二百二十日",
         | 
| 36 | 
            +
                  "彼岸入(秋)", "彼岸(秋)"  , "彼岸明(秋)", "社日(秋)"  ,
         | 
| 37 | 
            +
                  "土用入(秋)", "土用入(冬)"
         | 
| 38 | 
            +
                ]
         | 
| 39 | 
            +
                HOLIDAY = [
         | 
| 40 | 
            +
                  [ 0,  1,  1, 99, "元日"        ],
         | 
| 41 | 
            +
                  [ 1,  1, 99, 21, "成人の日"    ],
         | 
| 42 | 
            +
                  [ 2,  2, 11, 99, "建国記念の日"],
         | 
| 43 | 
            +
                  [ 3,  3, 99, 80, "春分の日"    ],
         | 
| 44 | 
            +
                  [ 4,  4, 29, 99, "昭和の日"    ],
         | 
| 45 | 
            +
                  [ 5,  5,  3, 99, "憲法記念日"  ],
         | 
| 46 | 
            +
                  [ 6,  5,  4, 99, "みどりの日"  ],
         | 
| 47 | 
            +
                  [ 7,  5,  5, 99, "こどもの日"  ],
         | 
| 48 | 
            +
                  [ 8,  7, 99, 31, "海の日"      ],
         | 
| 49 | 
            +
                  [ 9,  8, 11, 99, "山の日"      ],
         | 
| 50 | 
            +
                  [10,  9, 99, 31, "敬老の日"    ],
         | 
| 51 | 
            +
                  [11,  9, 99, 81, "秋分の日"    ],
         | 
| 52 | 
            +
                  [12, 10, 99, 21, "体育の日"    ],
         | 
| 53 | 
            +
                  [13, 11,  3, 99, "文化の日"    ],
         | 
| 54 | 
            +
                  [14, 11, 23, 99, "勤労感謝の日"],
         | 
| 55 | 
            +
                  [15, 12, 23, 99, "天皇誕生日"  ],
         | 
| 56 | 
            +
                  [90, 99, 99, 99, "国民の休日"  ],
         | 
| 57 | 
            +
                  [91, 99, 99, 99, "振替休日"    ]
         | 
| 58 | 
            +
                ]
         | 
| 59 | 
            +
              end
         | 
| 60 | 
            +
            end
         | 
| 61 | 
            +
             | 
    
        data/mk_cal_jpl.gemspec
    ADDED
    
    | @@ -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 'mk_cal_jpl/version'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            Gem::Specification.new do |spec|
         | 
| 7 | 
            +
              spec.name          = "mk_cal_jpl"
         | 
| 8 | 
            +
              spec.version       = MkCalJpl::VERSION
         | 
| 9 | 
            +
              spec.authors       = ["komasaru"]
         | 
| 10 | 
            +
              spec.email         = ["masaru@mk-mode.com"]
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              spec.summary       = %q{Calendar library including Japan's old-calendar, using JPL DE430.}
         | 
| 13 | 
            +
              spec.description   = %q{MkCalJpl is a calendar library including Japan's old-calendar, using JPL DE430.}
         | 
| 14 | 
            +
              spec.homepage      = "https://github.com/komasaru/mk_cal_jpl"
         | 
| 15 | 
            +
              spec.license       = "MIT"
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
         | 
| 18 | 
            +
              # to allow pushing to a single host or delete this section to allow pushing to any host.
         | 
| 19 | 
            +
              #if spec.respond_to?(:metadata)
         | 
| 20 | 
            +
              #  spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
         | 
| 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        = "exe"
         | 
| 27 | 
            +
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         | 
| 28 | 
            +
              spec.require_paths = ["lib"]
         | 
| 29 | 
            +
             | 
| 30 | 
            +
              spec.add_dependency "mk_apos"
         | 
| 31 | 
            +
              spec.add_dependency "mk_coord"
         | 
| 32 | 
            +
              spec.add_development_dependency "bundler", "~> 1.12"
         | 
| 33 | 
            +
              spec.add_development_dependency "rake", "~> 10.0"
         | 
| 34 | 
            +
              spec.add_development_dependency "rspec", "~> 3.0"
         | 
| 35 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,134 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: mk_cal_jpl
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - komasaru
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: exe
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2016-09-17 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: mk_apos
         | 
| 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: mk_coord
         | 
| 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: bundler
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - "~>"
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '1.12'
         | 
| 48 | 
            +
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - "~>"
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '1.12'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: rake
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '10.0'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '10.0'
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: rspec
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '3.0'
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - "~>"
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '3.0'
         | 
| 83 | 
            +
            description: MkCalJpl is a calendar library including Japan's old-calendar, using
         | 
| 84 | 
            +
              JPL DE430.
         | 
| 85 | 
            +
            email:
         | 
| 86 | 
            +
            - masaru@mk-mode.com
         | 
| 87 | 
            +
            executables:
         | 
| 88 | 
            +
            - mk_cal_jpl
         | 
| 89 | 
            +
            extensions: []
         | 
| 90 | 
            +
            extra_rdoc_files: []
         | 
| 91 | 
            +
            files:
         | 
| 92 | 
            +
            - ".gitignore"
         | 
| 93 | 
            +
            - ".rspec"
         | 
| 94 | 
            +
            - ".travis.yml"
         | 
| 95 | 
            +
            - Gemfile
         | 
| 96 | 
            +
            - Guardfile
         | 
| 97 | 
            +
            - LICENSE.txt
         | 
| 98 | 
            +
            - README.md
         | 
| 99 | 
            +
            - Rakefile
         | 
| 100 | 
            +
            - bin/console
         | 
| 101 | 
            +
            - bin/setup
         | 
| 102 | 
            +
            - exe/mk_cal_jpl
         | 
| 103 | 
            +
            - lib/mk_cal_jpl.rb
         | 
| 104 | 
            +
            - lib/mk_cal_jpl/argument.rb
         | 
| 105 | 
            +
            - lib/mk_cal_jpl/calendar.rb
         | 
| 106 | 
            +
            - lib/mk_cal_jpl/compute.rb
         | 
| 107 | 
            +
            - lib/mk_cal_jpl/const.rb
         | 
| 108 | 
            +
            - lib/mk_cal_jpl/version.rb
         | 
| 109 | 
            +
            - mk_cal_jpl.gemspec
         | 
| 110 | 
            +
            homepage: https://github.com/komasaru/mk_cal_jpl
         | 
| 111 | 
            +
            licenses:
         | 
| 112 | 
            +
            - MIT
         | 
| 113 | 
            +
            metadata: {}
         | 
| 114 | 
            +
            post_install_message: 
         | 
| 115 | 
            +
            rdoc_options: []
         | 
| 116 | 
            +
            require_paths:
         | 
| 117 | 
            +
            - lib
         | 
| 118 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 119 | 
            +
              requirements:
         | 
| 120 | 
            +
              - - ">="
         | 
| 121 | 
            +
                - !ruby/object:Gem::Version
         | 
| 122 | 
            +
                  version: '0'
         | 
| 123 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 124 | 
            +
              requirements:
         | 
| 125 | 
            +
              - - ">="
         | 
| 126 | 
            +
                - !ruby/object:Gem::Version
         | 
| 127 | 
            +
                  version: '0'
         | 
| 128 | 
            +
            requirements: []
         | 
| 129 | 
            +
            rubyforge_project: 
         | 
| 130 | 
            +
            rubygems_version: 2.6.6
         | 
| 131 | 
            +
            signing_key: 
         | 
| 132 | 
            +
            specification_version: 4
         | 
| 133 | 
            +
            summary: Calendar library including Japan's old-calendar, using JPL DE430.
         | 
| 134 | 
            +
            test_files: []
         |