Class: Gistim::Create
- Inherits:
-
Object
- Object
- Gistim::Create
- Defined in:
- lib/gistim/create.rb
Instance Attribute Summary collapse
-
#alias_name ⇒ Object
readonly
Returns the value of attribute alias_name.
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Object
- #gist_hash ⇒ Object
-
#initialize(alias_name: nil) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(alias_name: nil) ⇒ Create
Returns a new instance of Create.
3 4 5 |
# File 'lib/gistim/create.rb', line 3 def initialize(alias_name: nil) @alias_name = alias_name end |
Instance Attribute Details
#alias_name ⇒ Object (readonly)
Returns the value of attribute alias_name.
7 8 9 |
# File 'lib/gistim/create.rb', line 7 def alias_name @alias_name end |
Class Method Details
.implement ⇒ Object
53 54 55 |
# File 'lib/gistim/create.rb', line 53 def implement self.class.new.create end |
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gistim/create.rb', line 9 def create File.write(initialize_file_path, 'Wellcome to Gist! ( created by gistim )') create_empty clone File.delete(initialize_file_path) # FIME: write good structured work flow and good test # File.write("#{clone_directory}/.gist.url", gist_url) # File.write("#{clone_directory}/.gist.hash", gist_hash) self end |
#gist_hash ⇒ Object
24 25 26 |
# File 'lib/gistim/create.rb', line 24 def gist_hash gist_url.chomp.gsub(/\A.+\//, '') end |