gongora 0.0.1
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/lib/gongora.rb +31 -0
- metadata +46 -0
data/lib/gongora.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
class Gongora
|
|
3
|
+
def self.hi
|
|
4
|
+
puts "Hi, I\'m Góngora and I\'ll help you to write easily beatiful words"
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.write_words(words, file, dir="")
|
|
8
|
+
if dir.empty?
|
|
9
|
+
puts "I\'ll write in this directory... "
|
|
10
|
+
elsif self.exists_dir? dir
|
|
11
|
+
puts "Directory already existed..."
|
|
12
|
+
else
|
|
13
|
+
puts "Creating new directory #{dir}... "
|
|
14
|
+
Dir.mkdir(dir, 0755)
|
|
15
|
+
end
|
|
16
|
+
self.write_file words, file, dir
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
protected
|
|
20
|
+
def self.exists_dir?(dir)
|
|
21
|
+
File.directory? dir
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.write_file(words, file, dir)
|
|
25
|
+
dir.empty? ? path = "#{file}" : path = "#{dir}/#{file}"
|
|
26
|
+
puts "Creating #{file} and writting some beautiful words..."
|
|
27
|
+
File.open(path, "a") { |f| f.write(words) }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gongora
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Fernando Álvarez
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-10-22 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: I will help you to write easily beautiful words
|
|
15
|
+
email: alvarez.calleja.fernando@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/gongora.rb
|
|
21
|
+
homepage: http://rubygems.org/gems/gongora
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
post_install_message:
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
none: false
|
|
30
|
+
requirements:
|
|
31
|
+
- - ! '>='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
none: false
|
|
36
|
+
requirements:
|
|
37
|
+
- - ! '>='
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
requirements: []
|
|
41
|
+
rubyforge_project:
|
|
42
|
+
rubygems_version: 1.8.11
|
|
43
|
+
signing_key:
|
|
44
|
+
specification_version: 3
|
|
45
|
+
summary: My name is Góngora!
|
|
46
|
+
test_files: []
|