oynx 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f282b4c55f8cee6860ee69601166485b5ab60b3
4
- data.tar.gz: 3f74108caea61e1e4e55b3c293f1f6290898daa9
3
+ metadata.gz: 5d21996b214cbe4971ff3a09a29f42da5c424b07
4
+ data.tar.gz: 16704ef8ea97b000809aa0627174909678f25307
5
5
  SHA512:
6
- metadata.gz: a0f916fd7976b5c6baa77f1e9f7d8077338fa2b654b2e1d1d53caae91c4dd7a6343772e84abe9d2b858d3cf804064f646779bea3d160140b60fb256c1d158a46
7
- data.tar.gz: 030de219ec9d04a1547d1f79f1e526bf31cec30aa41515d00ed6470974e0c2887ae32294720df1c75fa9a413f6d0d3b46eaf3a7fd2562098b33187e75358b435
6
+ metadata.gz: 3daafcccc338d806f02c148366b94bcee08392fae7809a5cc92cb9b12631742d43f7bdb89e16413de825336f598d64df18a2a50d2706ea893e70b5b8d4be9c7c
7
+ data.tar.gz: 682c0fd84017e1cf4fb46b9fee7892d45e94118e62774d5d1331d6d6204d1191d6cbaa67a9de95d0fd59f500f8a65a8647bea561a6a8963798958af072edc14d
data/README.md CHANGED
@@ -26,9 +26,11 @@ Or install it yourself as:
26
26
 
27
27
  ## Usage
28
28
 
29
+ ### Creating a site
30
+
29
31
  $ oynx new
30
32
 
31
- ### Parameters
33
+ #### Parameters
32
34
 
33
35
  --default - create a default site
34
36
 
@@ -40,6 +42,18 @@ Or install it yourself as:
40
42
  --no-img - Don't create an image folder
41
43
  --no-js - Don't create a JS folder/stubs
42
44
 
45
+ ### Uploading a site
46
+
47
+ $ oynx upload
48
+
49
+ #### Required Parameters
50
+
51
+ --server, -s "URL/IP" - Server URL/IP Address
52
+ --port, -n "PORT" - Port to use
53
+ --user, -u "USERNAME" - Username
54
+ --dir, -d "DIRECTORY" - Directory to use
55
+ --compress, -c / --no-compress - Compresses the site / Doesn't compress the site
56
+
43
57
  ## Contributing
44
58
 
45
59
  1. Fork it ( http://github.com/mahimahi42/oynx/fork )
@@ -5,8 +5,10 @@ require "oynx/oynx_back"
5
5
  require "oynx/config"
6
6
 
7
7
  module Oynx
8
+ ##
9
+ # This class connects Oynx with Thor, to allow passing of CLI
10
+ # options. This is what the user will interact with.
8
11
  class Oynx_CLI < Thor
9
- attr_accessor :site
10
12
 
11
13
  desc "new", "create a new website"
12
14
  long_desc <<-LONGDESC
@@ -29,6 +31,10 @@ module Oynx
29
31
  option :css, :type => :boolean
30
32
  option :js, :type => :boolean
31
33
  option :img, :type => :boolean
34
+ ##
35
+ # If the user wants a +default+ website, create one.
36
+ # Else, gather our options into a configuration and
37
+ # create the site from that.
32
38
  def new
33
39
  if options[:default] then
34
40
  Oynx_Back.new.create_site()
@@ -39,7 +45,7 @@ module Oynx
39
45
  config["js"] = options[:js] if not options[:js]
40
46
  config["img"] = options[:img] if not options[:img]
41
47
 
42
- @site = Oynx_Back.new(config).create_site
48
+ Oynx_Back.new(config).create_site
43
49
  end
44
50
  end
45
51
 
@@ -53,7 +59,6 @@ module Oynx
53
59
  --server, -s "URL/IP" - Server URL/IP Address
54
60
  \x5--port, -n "PORT" - Port to use
55
61
  \x5--user, -u "USERNAME" - Username
56
- \x5--pass, -p "PASSWORD" - Password
57
62
  \x5--dir, -d "DIRECTORY" - Directory to use
58
63
  \x5--compress, -c / --no-compress - Compresses the site / Doesn't compress the site
59
64
  LONGDESC
@@ -62,12 +67,17 @@ module Oynx
62
67
  option :user, :aliases => :u, :required => true
63
68
  option :dir, :aliases => :d, :required => true
64
69
  option :compress, :aliases => :c, :type => :boolean
70
+ ##
71
+ # Uploads the site using the Oynx backend.
65
72
  def upload
66
73
  Oynx_Back.upload(options, config["name"], File.join(Dir.pwd, config["name"]))
67
74
  end
68
75
 
69
76
  private
70
77
 
78
+ ##
79
+ # Due to a Thor quirk, this is the best way to have a class variable,
80
+ # so we can store our website configuration
71
81
  def config
72
82
  @config ||= Web_Config.new
73
83
  end
@@ -1,7 +1,9 @@
1
+ ##
1
2
  # Web_Config is just a wrapper for a Hash with some custom keys
2
3
  # instantiated for Oynx use.
3
4
 
4
5
  class Web_Config < Hash
6
+ ##
5
7
  # Set our custom keys to default values
6
8
  def initialize()
7
9
  self["name"] = "new_site"
@@ -11,6 +13,7 @@ class Web_Config < Hash
11
13
  self["img"] = true
12
14
  end
13
15
 
16
+ ##
14
17
  # Our Web_Config as a String
15
18
  def to_s()
16
19
  ret = ""
@@ -3,17 +3,25 @@ require "zip"
3
3
 
4
4
  require_relative './config'
5
5
 
6
+ ##
7
+ # This is the Oynx backend. Most of the actual work done by Oynx
8
+ # is done here
6
9
  class Oynx_Back
10
+ ##
11
+ # +config+ is our website configuration, while +root+ is the
12
+ # root directory for the website
7
13
  attr_writer :config, :root
8
14
 
9
- # Set our configuration to either a blank configuration or one
10
- # supplied by the application. @root is the root folder of the
11
- # site
15
+ ##
16
+ # Set our +@config+ to either a blank configuration or one
17
+ # supplied by the application, and set our +@root+ to nil
18
+ # for now.
12
19
  def initialize(config = Web_Config.new)
13
20
  @config = config
14
21
  @root = nil
15
22
  end
16
23
 
24
+ ##
17
25
  # Call the various methods to create the website
18
26
  def create_site()
19
27
  create_root()
@@ -21,8 +29,15 @@ class Oynx_Back
21
29
  create_file_stubs()
22
30
  end
23
31
 
32
+ ##
24
33
  # Compress the site if specified, then upload it using `scp`
25
34
  # This is a class method due to quirks with Thor
35
+ #
36
+ # == Parameters
37
+ #
38
+ # +options+ - CLI options we get from Thor
39
+ # +site_name+ - Name of the website
40
+ # +dir+ - Directory on the server to use
26
41
  def Oynx_Back.upload(options, site_name, dir)
27
42
  user = options[:user]
28
43
  dir = options[:dir]
@@ -43,6 +58,7 @@ class Oynx_Back
43
58
  # Creating methods
44
59
  ##################
45
60
 
61
+ ##
46
62
  # Create the root folder for our site
47
63
  def create_root()
48
64
  tmp = File.join(Dir.pwd, @config["name"])
@@ -50,6 +66,7 @@ class Oynx_Back
50
66
  @root = tmp
51
67
  end
52
68
 
69
+ ##
53
70
  # Call the various methods to create our folders
54
71
  def create_inner_folders()
55
72
  create_css_folder()
@@ -57,6 +74,7 @@ class Oynx_Back
57
74
  create_js_folder()
58
75
  end
59
76
 
77
+ ##
60
78
  # Create a CSS folder if specified
61
79
  def create_css_folder()
62
80
  if @config["css"]
@@ -65,6 +83,7 @@ class Oynx_Back
65
83
  end
66
84
  end
67
85
 
86
+ ##
68
87
  # Create an image folder if specified
69
88
  def create_img_folder()
70
89
  if @config["img"]
@@ -73,6 +92,7 @@ class Oynx_Back
73
92
  end
74
93
  end
75
94
 
95
+ ##
76
96
  # Create a JS folder if specified
77
97
  def create_js_folder()
78
98
  if @config["js"]
@@ -81,6 +101,7 @@ class Oynx_Back
81
101
  end
82
102
  end
83
103
 
104
+ ##
84
105
  # First create our index.html template, then call the methods
85
106
  # to create css and js stubs
86
107
  def create_file_stubs()
@@ -106,6 +127,7 @@ class Oynx_Back
106
127
  create_js_file_stubs()
107
128
  end
108
129
 
130
+ ##
109
131
  # Creates a css stub file if specified
110
132
  def create_css_file_stubs()
111
133
  if @config["css"] then
@@ -114,6 +136,7 @@ class Oynx_Back
114
136
  end
115
137
  end
116
138
 
139
+ ##
117
140
  # Creates a js stub file if specified
118
141
  def create_js_file_stubs()
119
142
  if @config["js"] then
@@ -126,6 +149,7 @@ class Oynx_Back
126
149
  # Uploading methods
127
150
  ###################
128
151
 
152
+ ##
129
153
  # Compresses the site
130
154
  def Oynx_Back.compress_site(name)
131
155
  archive = File.join(Dir.pwd, "#{name}.zip")
@@ -1,3 +1,5 @@
1
1
  module Oynx
2
- VERSION = "0.2.0"
2
+ ##
3
+ # Version number for the Oynx gem
4
+ VERSION = "0.3.0"
3
5
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oynx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryce Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Oynx simplifies several aspects of web development
@@ -60,9 +60,8 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".gitignore"
63
+ - .gitignore
64
64
  - Gemfile
65
- - LICENSE
66
65
  - LICENSE.txt
67
66
  - README.md
68
67
  - Rakefile
@@ -82,17 +81,17 @@ require_paths:
82
81
  - lib
83
82
  required_ruby_version: !ruby/object:Gem::Requirement
84
83
  requirements:
85
- - - ">="
84
+ - - '>='
86
85
  - !ruby/object:Gem::Version
87
86
  version: '0'
88
87
  required_rubygems_version: !ruby/object:Gem::Requirement
89
88
  requirements:
90
- - - ">="
89
+ - - '>='
91
90
  - !ruby/object:Gem::Version
92
91
  version: '0'
93
92
  requirements: []
94
93
  rubyforge_project:
95
- rubygems_version: 2.2.2
94
+ rubygems_version: 2.0.3
96
95
  signing_key:
97
96
  specification_version: 4
98
97
  summary: Oynx WebDev Helper
data/LICENSE DELETED
@@ -1,21 +0,0 @@
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.