oynx 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 69a495fc15ce94bc0f6d3c16a85f8d15c6232496
4
+ data.tar.gz: c4486174e9d7ddcb7f991103fd950cfd72579a0a
5
+ SHA512:
6
+ metadata.gz: ba02f25eba98297e466e6a08c86a4d82d4fd8b28c5bad86eb17de7a2c685fc89d2609a73705f2ec3c3c212ea6eb532fea29247ef7b1906d7da56d77069fb86f6
7
+ data.tar.gz: 88bd37c00b79cc6d8e1431144dabcc374dcd0dc11347740585e9b37a74693a983e94838d3c23cc0a0e0031124005542293ea258f74611f289db36b802b7420fb
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in oynx.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 mahimahi42
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Bryce Davis
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,29 @@
1
+ # Oynx
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'oynx'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install oynx
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/oynx/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/oynx ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'oynx'
4
+
5
+ Oynx::Oynx_CLI.start(ARGV)
data/lib/oynx.rb ADDED
@@ -0,0 +1,45 @@
1
+ require "thor"
2
+
3
+ require "oynx/version"
4
+ require "oynx/oynx_back"
5
+
6
+ module Oynx
7
+ class Oynx_CLI < Thor
8
+ desc "new", "create a new website"
9
+ long_desc <<-LONGDESC
10
+ `oynx new` will create a new website in the current directory.
11
+
12
+ Optional Parameters
13
+ \x5-------------------
14
+
15
+ --default - Create a site with default information.
16
+
17
+ --name "NAME" - Specify the site's name.
18
+ \x5--charset "CHSH" - Specify the charset to use.
19
+ \x5--no-css - Don't create a CSS folder or stubs.
20
+ \x5--no-img - Don't create an image folder.
21
+ \x5--no-js - Don't create a JS folder or stubs.
22
+ LONGDESC
23
+ option :default, :type => :boolean, :aliases => :d
24
+ option :name
25
+ option :charset
26
+ option :css, :type => :boolean
27
+ option :js, :type => :boolean
28
+ option :img, :type => :boolean
29
+ def new
30
+ if options[:default] then
31
+ Oynx_Back.new.create_site()
32
+ else
33
+ config = {}
34
+
35
+ config["name"] = options[:name] if options[:name]
36
+ config["charset"] = options[:charset] if options[:charset]
37
+ config["css"] = options[:css] if not options[:css]
38
+ config["js"] = options[:js] if not options[:js]
39
+ config["img"] = options[:img] if not options[:img]
40
+
41
+ Oynx_Back.new(config).create_site
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,17 @@
1
+ class Web_Config < Hash
2
+ def initialize()
3
+ self["name"] = "new_site"
4
+ self["charset"] = "utf-8"
5
+ self["css"] = true
6
+ self["js"] = true
7
+ self["img"] = true
8
+ end
9
+
10
+ def to_s()
11
+ ret = ""
12
+ self.each_pair do |key, val|
13
+ ret += "#{key}: #{val}\n"
14
+ end
15
+ return ret
16
+ end
17
+ end
data/lib/oynx/main.rb ADDED
@@ -0,0 +1,4 @@
1
+ require './setup'
2
+
3
+ Setup.welcome()
4
+ Setup.get_site_info()
@@ -0,0 +1,85 @@
1
+ require_relative './config'
2
+
3
+ class Oynx_Back
4
+ attr_writer :config
5
+
6
+ def initialize(config = Web_Config.new)
7
+ @config = config
8
+ @root = nil
9
+ end
10
+
11
+ def create_site()
12
+ create_root()
13
+ create_inner_folders()
14
+ create_file_stubs()
15
+ end
16
+
17
+ private
18
+
19
+ def create_root()
20
+ tmp = File.join(Dir.pwd, @config["name"])
21
+ Dir.mkdir(tmp)
22
+ @root = Dir.new(tmp)
23
+ end
24
+
25
+ def create_inner_folders()
26
+ create_css_folder()
27
+ create_img_folder()
28
+ create_js_folder()
29
+ end
30
+
31
+ def create_css_folder()
32
+ if @config["css"]
33
+ css = File.join(@root, "css")
34
+ Dir.mkdir(css)
35
+ end
36
+ end
37
+
38
+ def create_img_folder()
39
+ if @config["img"]
40
+ img = File.join(@root, "img")
41
+ Dir.mkdir(img)
42
+ end
43
+ end
44
+
45
+ def create_js_folder()
46
+ if @config["js"]
47
+ js = File.join(@root, "js")
48
+ Dir.mkdir(js)
49
+ end
50
+ end
51
+
52
+ def create_file_stubs()
53
+ index_text = "<!DOCTYPE HTML>
54
+ <html>
55
+ <head>
56
+ <meta charset='#{@config["charset"]}'>
57
+ <meta name='viewport' content='width=device-width,initial-scale=1.0'>
58
+ </head>
59
+
60
+ <body>
61
+
62
+ </body>
63
+ </html>"
64
+
65
+ index_file = File.join(@root, "index.html")
66
+ File.open(index_file, "a") {|f| f.write(index_text)}
67
+
68
+ create_css_file_stubs()
69
+ create_js_file_stubs()
70
+ end
71
+
72
+ def create_css_file_stubs()
73
+ if @config["css"] then
74
+ css_file = File.join(@root, "css/styles.css")
75
+ File.open(css_file, "a")
76
+ end
77
+ end
78
+
79
+ def create_js_file_stubs()
80
+ if @config["js"] then
81
+ js_file = File.join(@root, "js/scripts.js")
82
+ File.open(js_file, "a")
83
+ end
84
+ end
85
+ end
data/lib/oynx/setup.rb ADDED
@@ -0,0 +1,42 @@
1
+ require './config'
2
+
3
+ module Setup
4
+ def Setup.welcome()
5
+ puts "Welcome to Oynx!"
6
+ puts "This tool will simplify your life as a web guru."
7
+ puts "\n\n"
8
+ end
9
+
10
+ def Setup.get_site_info()
11
+ puts "First, let's get some info about the site."
12
+ name = Setup.get_site_name()
13
+ chst = Setup.set_charset()
14
+ c = Setup.finish_config(name, chst)
15
+ end
16
+
17
+ private
18
+
19
+ def Setup.get_site_name()
20
+ print "Website Name: "
21
+ gets.chomp!
22
+ end
23
+
24
+ def Setup.set_charset()
25
+ charset = "utf-8"
26
+ print "Charset [#{charset}]: "
27
+ input = gets.chomp!
28
+ case input
29
+ when ""
30
+ return charset
31
+ else
32
+ return input
33
+ end
34
+ end
35
+
36
+ def Setup.finish_config(name, chst)
37
+ config = Web_Config.new
38
+ config.set_name(name)
39
+ config.set_charset(chst)
40
+ return config
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ module Oynx
2
+ VERSION = "0.0.1"
3
+ end
data/oynx.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'oynx/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "oynx"
8
+ spec.version = Oynx::VERSION
9
+ spec.authors = ["Bryce Davis"]
10
+ spec.email = ["me@bryceadavis.com"]
11
+ spec.summary = %q{Oynx WebDev Helper}
12
+ spec.description = %q{Oynx simplifies several aspects of web development}
13
+ spec.homepage = "http://bryceadavis.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = ["oynx"]
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
24
+
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: oynx
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bryce Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-03 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: Oynx simplifies several aspects of web development
42
+ email:
43
+ - me@bryceadavis.com
44
+ executables:
45
+ - oynx
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/oynx
56
+ - lib/oynx.rb
57
+ - lib/oynx/config.rb
58
+ - lib/oynx/main.rb
59
+ - lib/oynx/oynx_back.rb
60
+ - lib/oynx/setup.rb
61
+ - lib/oynx/version.rb
62
+ - oynx.gemspec
63
+ homepage: http://bryceadavis.com
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.2.2
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Oynx WebDev Helper
87
+ test_files: []