ask_year_month 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a9a165f7e16ac6649abc0679192aeef1019b04f71803f00addd4117eb8b8273b
4
+ data.tar.gz: cf54b88753872c17b111a2f26378b65edd7328d4e2feefdefcb33dd933691b76
5
+ SHA512:
6
+ metadata.gz: 3aba5638cfb6f989486aafbb347634839bc88ca25b195cde3373fb329887d7114cf0827832eef5d95f6d00962b615c020a8b5bf5d71153864a84464b2e63c3d0
7
+ data.tar.gz: 6f36b3e76d9eb993940ca282cf44bd47239f0aa07d08da5a59a9864283be2a77c9dff5f5a772bfbfdae803eefe5fd0d269ad6a38eb2c845cb8e492a0f309acb2
@@ -0,0 +1,20 @@
1
+ Copyright 2020 mah666hhh
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # AskYearMonth
2
+ You can simply check **what month, what year** it is by the name of the month and year.
3
+ (Year is not implemented. coming soon...)
4
+
5
+ This Gem was extend [Date, DateTime, Time, ActiveSupport::TimeWithZone].
6
+
7
+ ## example
8
+
9
+ ```
10
+ # Not beautiful...
11
+ DateTime.parse('2020-12-05').month == 12
12
+ #=> true
13
+
14
+ # It's beautiful!
15
+ DateTime.parse('2020-12-05').december?
16
+ #=> true
17
+ ```
18
+
19
+ ## Usage
20
+ How to use my plugin.
21
+
22
+ ## Installation
23
+ Add this line to your application's Gemfile:
24
+
25
+ ```ruby
26
+ gem 'ask_year_month'
27
+ ```
28
+
29
+ And then execute:
30
+ ```bash
31
+ $ bundle
32
+ ```
33
+
34
+ Or install it yourself as:
35
+ ```bash
36
+ $ gem install ask_year_month
37
+ ```
38
+
39
+ ## Contributing
40
+ Contribution directions go here.
41
+
42
+ ## License
43
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'AskYearMonth'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ require 'bundler/gem_tasks'
@@ -0,0 +1,9 @@
1
+ # Your code goes here...
2
+ if defined?(Rails::Railtie)
3
+ require 'ask_year_month/railtie'
4
+ else
5
+ raise 'Error.'
6
+ end
7
+
8
+ module AskYearMonth
9
+ end
@@ -0,0 +1,56 @@
1
+ module AskYearMonth
2
+ module MonthNameHelper
3
+ def january?
4
+ month == 1
5
+ end
6
+
7
+ def february?
8
+ month == 2
9
+ end
10
+
11
+ def march?
12
+ month == 3
13
+ end
14
+
15
+ def april?
16
+ month == 4
17
+ end
18
+
19
+ def may?
20
+ month == 5
21
+ end
22
+
23
+ def june?
24
+ month == 6
25
+ end
26
+
27
+ def july?
28
+ month == 7
29
+ end
30
+
31
+ def august?
32
+ month == 8
33
+ end
34
+
35
+ def september?
36
+ month == 9
37
+ end
38
+
39
+ def october?
40
+ month == 10
41
+ end
42
+
43
+ def november?
44
+ month == 11
45
+ end
46
+
47
+ def december?
48
+ month == 12
49
+ end
50
+
51
+ ::Time.send :include, self
52
+ ::Date.send :include, self
53
+ ::DateTime.send :include, self
54
+ ::ActiveSupport::TimeWithZone.send :include, self
55
+ end
56
+ end
@@ -0,0 +1,9 @@
1
+ module AskYearMonth
2
+ class Railtie < ::Rails::Railtie
3
+ initializer 'ask_year_month' do |app|
4
+ ActiveSupport.on_load :action_view do
5
+ require 'ask_year_month/month_name_helper'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module AskYearMonth
2
+ VERSION = '0.1.0'
3
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :ask_year_month do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ask_year_month
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mah666hhh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.3
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.0.3.4
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 6.0.3
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.0.3.4
33
+ - !ruby/object:Gem::Dependency
34
+ name: sqlite3
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: You can use this gem to get the name of the month.
48
+ email:
49
+ - mah666hhh@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - MIT-LICENSE
55
+ - README.md
56
+ - Rakefile
57
+ - lib/ask_year_month.rb
58
+ - lib/ask_year_month/month_name_helper.rb
59
+ - lib/ask_year_month/railtie.rb
60
+ - lib/ask_year_month/version.rb
61
+ - lib/ask_year_month/year_name_helper.rb
62
+ - lib/tasks/ask_year_month_tasks.rake
63
+ homepage: https://github.com/mah666hhh/ask_year_month
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubygems_version: 3.0.3
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Get the name of the month.
86
+ test_files: []