dok 0.0.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
+ SHA1:
3
+ metadata.gz: d955796b35727feb2b20b0c1f86050d5a9217e18
4
+ data.tar.gz: 9b270e4fa8c3f5040b4e822048784b362ef7aceb
5
+ SHA512:
6
+ metadata.gz: 8e8d7bc4e844442ca4e1936936d8b97a8a69e708380be88703b1c8fe55b5d1bde39184be267f9f9d4b444edc62ed4b80aa7210058d83c3d1747895154adab63b
7
+ data.tar.gz: ce460ac1199d2c3ee6332d01d914b62d6bd86cc90cf0236ff465c8970389a636faee06c22e2e0b733cfb6d4fa1eef2e5d9aae1b45eed1aaf1547a1f46c9c34a5
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 marvell
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.
@@ -0,0 +1,31 @@
1
+ # Dok
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'dok'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install dok
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/dok/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/dok ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'dok/cli'
4
+
5
+ Dok::CLI.start(ARGV)
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'dok'
5
+ spec.version = '0.0.0'
6
+ spec.authors = ['marvell']
7
+ spec.email = ['alex@ndr.su']
8
+ spec.summary = 'Dok is ...'
9
+ spec.description = ''
10
+ spec.homepage = 'https://github.com/marvell/dok'
11
+ spec.license = 'MIT'
12
+
13
+ spec.files = `git ls-files -z`.split("\x0")
14
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.require_paths = ['lib']
17
+
18
+ spec.add_dependency 'thor', '~> 0.19.1'
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.7'
21
+ spec.add_development_dependency 'rake', '~> 10.0'
22
+ end
@@ -0,0 +1,18 @@
1
+ require 'dok/config'
2
+
3
+ module Dok
4
+ class Application
5
+
6
+ attr_reader :root, :config
7
+
8
+ def initialize
9
+ @root = Dir.pwd
10
+ @config = Config.new(@root)
11
+ end
12
+
13
+ def init
14
+ @config.init()
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ require 'dok'
2
+ require 'thor'
3
+
4
+ module Dok
5
+ class CLI < Thor
6
+
7
+ desc 'init', 'create initial directories'
8
+ def init
9
+ config = Application.new.config
10
+
11
+ if config.base_directory_exists?
12
+ say "#{config.path} is already exists", :red
13
+ else
14
+ begin
15
+ config.create_directories
16
+ config.touch
17
+ say "OK", :green
18
+ rescue e
19
+ say e.message, :red
20
+ end
21
+ end
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ require 'fileutils'
2
+
3
+ module Dok
4
+ class Config
5
+
6
+ CONFIG_DIRECTORY = '.dok'
7
+ CONFIG_FILE = 'config.rb'
8
+
9
+ attr_reader :path
10
+
11
+ def initialize(path)
12
+ @path = File.join(path, CONFIG_DIRECTORY)
13
+ end
14
+
15
+ def base_directory_exists?
16
+ File.exists?(@path)
17
+ end
18
+
19
+ def create_directories(environments = ['development', 'production'])
20
+ Dir.mkdir(@path)
21
+ environments.each { |env| Dir.mkdir(File.join(@path, env)) }
22
+ end
23
+
24
+ def touch
25
+ FileUtils.touch(File.join(@path, CONFIG_FILE))
26
+ end
27
+
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dok
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - marvell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.19.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.19.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: ''
56
+ email:
57
+ - alex@ndr.su
58
+ executables:
59
+ - dok
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/dok
69
+ - dok.gemspec
70
+ - lib/dok.rb
71
+ - lib/dok/cli.rb
72
+ - lib/dok/config.rb
73
+ homepage: https://github.com/marvell/dok
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Dok is ...
97
+ test_files: []