rudate 0.0.1 → 0.0.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.
data/README ADDED
@@ -0,0 +1,5 @@
1
+ Rudate.to_s(Year,Month,Day) # convert from YMD to russian date
2
+ etc. Rudate.to_s(1900,1,1) will output "1 Января 1900г"
3
+
4
+ Rudate.to_s(Unix_time) # convert from unix time to russian date
5
+ etc. Rudate.to_s(0) will output "1 Января 1970г"
Binary file
@@ -1,3 +1,3 @@
1
1
  module Rudate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/rudate.rb CHANGED
@@ -1,8 +1,17 @@
1
1
  require "rudate/version"
2
2
 
3
3
  module Rudate
4
- def self.hello
5
- puts "hello"
4
+ def self.to_s(year, month, day)
5
+ month_names = %w{nil Января Февраля Марта Апреля Мая Июня Июля Августа Сентября Октября Ноября Декабря}
6
+ day.to_s + " " + month_names[month].to_s + " " + year.to_s + "г"
6
7
  end
7
8
 
9
+ def self.to_s(tm)
10
+ day = tm.strftime("%d").to_i
11
+ month = tm.strftime("%m").to_i
12
+ year = tm.strftime("%Y").to_i
13
+ Dateru.to_s(year,month,day)
14
+ end
15
+
16
+
8
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -20,7 +20,9 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
22
  - Gemfile
23
+ - README
23
24
  - Rakefile
25
+ - lib/.rudate.rb.swp
24
26
  - lib/rudate.rb
25
27
  - lib/rudate/version.rb
26
28
  - rudate.gemspec