jektop 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c48f0aecff4f17e3af4af7a780150391dfde4708
4
+ data.tar.gz: 932a438b573906989616cfdf8f2a23c3e97d921f
5
+ SHA512:
6
+ metadata.gz: ef975ed5ee1910bd100ff2b5f840002f207ee4abe37de264ac8fef32859a17af0ef23576189f23bdb9c93126b104d6173708f67334c225911c01dad24e2c176e
7
+ data.tar.gz: 570c1333a36e68bd92ef243b29bc0bc6882381b6a5f0285a78bdbbdd42ba68907fe5268b2e04b976505b0380bcbddbc77ddb1cb89b4c1199d38c5a64ac3502be
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jektop.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Markus Jylhänkangas
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Jektop
2
+
3
+ With this gem you can easily create new Jekyll posts
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'jektop'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install jektop
18
+
19
+ ## Usage
20
+
21
+ Using this gem is pretty simple
22
+
23
+ '''ruby
24
+ require 'jektop'
25
+
26
+ Jektop.new("LOCATION", "TITLE", "CATEGORIES", "YOUR POST")
27
+ '''
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 5. Create new Pull Request
36
+
37
+ ## TODO
38
+
39
+ - Make Jekyll.get function
40
+ - with variables, exmample "categories", "post", "title", "date"
41
+ - and Jekyll.edit something like this maby?
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/build.sh ADDED
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ gem build jektop.gemspec
4
+ gem install ./jektop-*.*.*.gem
data/jektop.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jektop/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jektop"
8
+ spec.version = Jektop::VERSION
9
+ spec.authors = ["Markus Jylhänkangas"]
10
+ spec.email = ["markus@jylhis.com"]
11
+ spec.summary = %q{Make Jekyll posts easily}
12
+ spec.description = %q{Ever wanted to make Jekyll post easily? Now you can with this gem}
13
+ spec.homepage = "https://github.com/Jylhis/Jektop"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,51 @@
1
+ module Jektop
2
+ class Date
3
+ def self.give_date(inpost)
4
+ t = Time.now
5
+ year = t.year.to_s
6
+ month = t.month.to_i
7
+ day = t.day.to_i
8
+ hour = t.hour.to_i
9
+ minute = t.min.to_i
10
+ second = t.sec.to_i
11
+
12
+ if month < 10
13
+ month = "0"+t.month.to_s
14
+ else
15
+ month = t.month.to_s
16
+ end
17
+
18
+ if day < 10
19
+ day = "0"+t.day.to_s
20
+ else
21
+ day = t.day.to_s
22
+ end
23
+
24
+ if hour < 10
25
+ hour = "0"+t.hour.to_s
26
+ else
27
+ hour = t.hour.to_s
28
+ end
29
+
30
+ if minute < 10
31
+ minute = "0"+t.min.to_s
32
+ else
33
+ minute = t.min.to_s
34
+ end
35
+
36
+ if second < 10
37
+ second = "0"+t.sec.to_s
38
+ else
39
+ second = t.sec.to_s
40
+ end
41
+
42
+ if inpost == true
43
+ date = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second
44
+ elsif inpost == false
45
+ date = year+"-"+month+"-"+day
46
+ end
47
+
48
+ return date
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ module Jektop
2
+ VERSION = "0.1.1"
3
+ end
data/lib/jektop.rb ADDED
@@ -0,0 +1,28 @@
1
+ def require_all(path)
2
+ glob = File.join(File.dirname(__FILE__), path, '*.rb')
3
+ Dir[glob].each do |f|
4
+ require f
5
+ end
6
+ end
7
+
8
+ require "jektop/version"
9
+ require "jektop/date"
10
+
11
+ module Jektop
12
+
13
+ def self.new(location, title_in, categories_in, post_in)
14
+
15
+ blog_location = location
16
+ title = title_in
17
+ categories = categories_in
18
+ post_text = post_in
19
+
20
+ date = Jektop::Date.give_date false
21
+ new_post = File.new("#{blog_location}#{date}-#{title}.markdown", "w")
22
+
23
+ date = Jektop::Date.give_date true
24
+ new_post.puts("---\nlayout: post\ntitle: #{title}\ndate: #{date}\ncategories: #{categories}\n---\n#{post_text}")
25
+ new_post.close
26
+ end
27
+
28
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jektop
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Markus Jylhänkangas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Ever wanted to make Jekyll post easily? Now you can with this gem
42
+ email:
43
+ - markus@jylhis.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - build.sh
54
+ - jektop.gemspec
55
+ - lib/jektop.rb
56
+ - lib/jektop/date.rb
57
+ - lib/jektop/version.rb
58
+ homepage: https://github.com/Jylhis/Jektop
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.2.2
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Make Jekyll posts easily
82
+ test_files: []