pakyow 0.8rc1 → 0.8.rc4

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.
Files changed (31) hide show
  1. checksums.yaml +7 -0
  2. data/bin/pakyow +18 -0
  3. data/lib/commands/USAGE +9 -0
  4. data/lib/commands/USAGE-CONSOLE +12 -0
  5. data/lib/commands/USAGE-NEW +11 -0
  6. data/lib/commands/USAGE-SERVER +16 -0
  7. data/lib/commands/console.rb +17 -0
  8. data/lib/commands/server.rb +27 -0
  9. data/lib/generators/pakyow/app/app_generator.rb +58 -0
  10. data/lib/generators/pakyow/app/templates/Gemfile +8 -0
  11. data/lib/generators/pakyow/app/templates/README.md +20 -0
  12. data/lib/generators/pakyow/app/templates/app.rb +26 -0
  13. data/lib/generators/pakyow/app/templates/app/lib/bindings.rb +3 -0
  14. data/lib/generators/pakyow/app/templates/app/lib/helpers.rb +3 -0
  15. data/lib/generators/pakyow/app/templates/app/lib/routes.rb +8 -0
  16. data/lib/generators/pakyow/app/templates/app/views/_templates/pakyow.html +17 -0
  17. data/lib/generators/pakyow/app/templates/config.ru +5 -0
  18. data/lib/generators/pakyow/app/templates/public/favicon.ico +0 -0
  19. data/lib/generators/pakyow/app/templates/public/pakyow-css/CHANGES +3 -0
  20. data/lib/generators/pakyow/app/templates/public/pakyow-css/README.md +3 -0
  21. data/lib/generators/pakyow/app/templates/public/pakyow-css/VERSION +1 -0
  22. data/lib/generators/pakyow/app/templates/public/pakyow-css/examples/extension.css +7 -0
  23. data/lib/generators/pakyow/app/templates/public/pakyow-css/examples/structure-fluid.html +150 -0
  24. data/lib/generators/pakyow/app/templates/public/pakyow-css/examples/structure.html +156 -0
  25. data/lib/generators/pakyow/app/templates/public/pakyow-css/examples/styled.html +114 -0
  26. data/lib/generators/pakyow/app/templates/public/pakyow-css/reset.css +48 -0
  27. data/lib/generators/pakyow/app/templates/public/pakyow-css/structure.css +264 -0
  28. data/lib/generators/pakyow/app/templates/public/pakyow-css/style.css +219 -0
  29. data/lib/generators/pakyow/app/templates/public/pakyow-css/syntax.css +90 -0
  30. data/lib/generators/pakyow/app/templates/rakefile +4 -0
  31. metadata +66 -27
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fe0c1205e5a5fff7bc1d19bb26ee91ab8089585b
4
+ data.tar.gz: 2015e354b2da1e7cc6e0fd01f0ca8e588c30dafb
5
+ SHA512:
6
+ metadata.gz: 4d4ac6019395f790188831009cdd1d6041c63a4e7eea1953a0a27109cc60e4862ae776e9efd30a01f36fa6bf6357a67708af0d4b727e6707c4a09e0411d0b450
7
+ data.tar.gz: 27565464df7d419e6925431e46ecb36c02c448170bda1e6e34341a34c6254937025a826c00de623e110482adb91c833e5739c63514b469e708c3833865bee0f3
data/bin/pakyow ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ PAK_PATH = File.expand_path('../../lib', __FILE__)
4
+
5
+ case ARGV.first
6
+ when 'new'
7
+ ARGV.shift
8
+ require File.join(PAK_PATH, 'generators/pakyow/app/app_generator')
9
+ Pakyow::Generators::AppGenerator.start
10
+ when 'server', 's'
11
+ ARGV.shift
12
+ require File.join(PAK_PATH, 'commands/server')
13
+ when 'console', 'c'
14
+ ARGV.shift
15
+ require File.join(PAK_PATH, 'commands/console')
16
+ when '--help', '-h', nil
17
+ puts File.open(File.join(PAK_PATH, 'commands/USAGE')).read
18
+ end
@@ -0,0 +1,9 @@
1
+ Usage:
2
+ pakyow command
3
+
4
+ There are three commands:
5
+ new Create a new Pakyow application
6
+ server Start the application server
7
+ console Start the application console
8
+
9
+ Run a command with -h for more information.
@@ -0,0 +1,12 @@
1
+ Usage:
2
+ pakyow console [environment]
3
+
4
+ Description:
5
+ The 'pakyow console' command stages the application and starts an interactive
6
+ session. If environment is not specified, the default_environment defined by
7
+ your application will be used.
8
+
9
+ Example:
10
+ pakyow console development
11
+
12
+ This starts the console with the 'development' configuration.
@@ -0,0 +1,11 @@
1
+ Usage:
2
+ pakyow new application
3
+
4
+ Description:
5
+ The 'pakyow new' command creates a new Pakyow application at the path
6
+ specified.
7
+
8
+ Example:
9
+ pakyow new path/to/application
10
+
11
+ This generates a new Pakyow application in path/to/application.
@@ -0,0 +1,16 @@
1
+ Usage:
2
+ pakyow server [environment] [-p port]
3
+
4
+ Description:
5
+ The 'pakyow server' command starts the application server.
6
+
7
+ If environment is not specified, the default_environment defined
8
+ by your application will be used.
9
+
10
+ If port is not specified, the port defined
11
+ by your application will be used (defaults to 3000).
12
+
13
+ Example:
14
+ pakyow server development -p 3001
15
+
16
+ This starts the application server on port 3001 with the 'development' configuration.
@@ -0,0 +1,17 @@
1
+ if ARGV.first == '--help' || ARGV.first == '-h'
2
+ puts File.open(File.join(PAK_PATH, 'commands/USAGE-CONSOLE')).read
3
+ else
4
+ $:.unshift(Dir.pwd)
5
+
6
+ require 'app'
7
+ Pakyow::App.stage(ARGV.first)
8
+
9
+ def reload
10
+ puts "Reloading..."
11
+ Pakyow.app.reload
12
+ end
13
+
14
+ require 'irb'
15
+ ARGV.clear
16
+ IRB.start
17
+ end
@@ -0,0 +1,27 @@
1
+ if ARGV.first == '--help' || ARGV.first == '-h'
2
+ puts File.open(File.join(PAK_PATH, 'commands/USAGE-SERVER')).read
3
+ else
4
+ $:.unshift(Dir.pwd)
5
+
6
+ require 'app'
7
+
8
+ valid_args = true
9
+ if port_arg = ARGV.index("-p")
10
+ if ARGV[port_arg + 1] =~ /^\d{1,5}$/
11
+ Pakyow::Config::Server.port = ARGV[port_arg + 1]
12
+ ARGV.delete_at(port_arg + 1)
13
+ ARGV.delete_at(port_arg)
14
+ else
15
+ valid_args = false
16
+ end
17
+ elsif port_arg = ARGV.index {|a| a =~ /^--port=\d{1,5}$/}
18
+ Pakyow::Config::Server.port = ARGV[port_arg].gsub(/--port=/, '')
19
+ ARGV.delete_at(port_arg)
20
+ end
21
+
22
+ if valid_args
23
+ Pakyow::App.run(ARGV.first)
24
+ else
25
+ puts File.open(File.join(PAK_PATH, 'commands/USAGE-SERVER')).read
26
+ end
27
+ end
@@ -0,0 +1,58 @@
1
+ require 'fileutils'
2
+
3
+ module Pakyow
4
+ module Generators
5
+ class AppGenerator
6
+ class << self
7
+ def start
8
+ case ARGV.first
9
+ when '--help', '-h', nil
10
+ puts File.open(File.join(PAK_PATH, 'commands/USAGE-NEW')).read
11
+ else
12
+ generator = self.new(ARGV.first)
13
+ generator.build
14
+ end
15
+ end
16
+ end
17
+
18
+ def initialize(dest)
19
+ @src = "#{File.expand_path('../', __FILE__)}/templates/."
20
+ @dest = dest
21
+ end
22
+
23
+ def build
24
+ puts "Generating project: #{@dest}"
25
+
26
+ if !File.directory?(@dest) || (Dir.entries(@dest) - ['.', '..']).empty?
27
+ copy
28
+ else
29
+ ARGV.clear
30
+ print "The folder '#{@dest}' is in use. Would you like to populate it anyway? [Yn] "
31
+
32
+ if gets.chomp! == 'Y'
33
+ copy
34
+ else
35
+ puts "Aborted!"
36
+ exit
37
+ end
38
+ end
39
+
40
+ exec
41
+ puts "Done!"
42
+ end
43
+
44
+ protected
45
+
46
+ # copies src files to dest
47
+ def copy
48
+ FileUtils.cp_r(@src, @dest)
49
+ end
50
+
51
+ # performs and other setup (e.g. bundle install)
52
+ def exec
53
+ puts "Running `bundle install`"
54
+ `cd #{@dest} && bundle install`
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "pakyow", "0.8.rc4"
4
+
5
+ # application server
6
+ gem "puma"
7
+
8
+ # your gems here
@@ -0,0 +1,20 @@
1
+ This app was generated for pakyow-0.8.
2
+
3
+ ---
4
+
5
+ # Getting Started
6
+
7
+ Start the server:
8
+
9
+ `pakyow server`
10
+
11
+ Fire up a console:
12
+
13
+ `pakyow console`
14
+
15
+ # Help
16
+
17
+ Full documentation is available at [pakyow.com/docs](http://pakyow.com/docs).
18
+
19
+ Having trouble? Find help on the [mailing list](http://groups.google.com/group/pakyow)
20
+ or file an issue on [GitHub Issues](https://github.com/metabahn/pakyow/issues).
@@ -0,0 +1,26 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'pakyow'
4
+
5
+ Pakyow::App.define do
6
+ configure :global do
7
+ # put global config here and they'll be available across environments
8
+ end
9
+
10
+ configure :development do
11
+ # put development config here
12
+ end
13
+
14
+ configure :prototype do
15
+ # an environment for running the front-end prototype with no backend
16
+ app.ignore_routes = true
17
+ end
18
+
19
+ configure :production do
20
+ # suggested production configuration
21
+ app.auto_reload = false
22
+ app.errors_in_browser = false
23
+
24
+ # put your production config here
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ Pakyow::App.bindings do
2
+ # define bindings here
3
+ end
@@ -0,0 +1,3 @@
1
+ module Pakyow::Helpers
2
+ # define methods here that are available from routes, bindings, etc
3
+ end
@@ -0,0 +1,8 @@
1
+ Pakyow::App.routes do
2
+ # define your routes here
3
+
4
+ # see something working by uncommenting the line below
5
+ # default do
6
+ # puts 'hello'
7
+ # end
8
+ end
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>
5
+ Pakyow
6
+ </title>
7
+
8
+ <link rel="stylesheet" type="text/css" href="/pakyow-css/structure.css">
9
+ <link rel="stylesheet" type="text/css" href="/pakyow-css/style.css">
10
+ </head>
11
+
12
+ <body>
13
+ <div class="container-1 margin-t">
14
+ <!-- @container -->
15
+ </div>
16
+ </body>
17
+ </html>
@@ -0,0 +1,5 @@
1
+ require File.expand_path('../app', __FILE__)
2
+
3
+ app = Pakyow::App
4
+ app.builder.run(app.stage(ENV['RACK_ENV']))
5
+ run app.builder.to_app
@@ -0,0 +1,3 @@
1
+ = 0.1 / 2013-06-12
2
+
3
+ * Initial release with structure, style, and syntax
@@ -0,0 +1,3 @@
1
+ Pakyow CSS is a set of styles that define a basic structure and look for a web-based app. Include it and start building. It's designed to be unintrusive, so you can add it to your app and use it for the long haul.
2
+
3
+ See the examples for more.
@@ -0,0 +1,7 @@
1
+ *[class*="container"] {
2
+ margin-top:20px;
3
+ }
4
+
5
+ *[class*="col"] {
6
+ background:#eee;
7
+ }
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Pakyow CSS</title>
5
+ <link rel="stylesheet" type="text/css" href="../structure.css">
6
+ <link rel="stylesheet" type="text/css" href="extension.css">
7
+ </head>
8
+
9
+ <body>
10
+ <div class="container fluid">
11
+ <h1>Fluid Layouts</h1>
12
+ </div>
13
+
14
+ <div class="container fluid">
15
+ <div class="col">
16
+ column1
17
+ </div>
18
+ </div>
19
+
20
+ <div class="container-2 fluid">
21
+ <div class="col">
22
+ column1
23
+ </div>
24
+
25
+ <div class="col">
26
+ column2
27
+ </div>
28
+ </div>
29
+
30
+ <div class="container-3 fluid">
31
+ <div class="col">
32
+ column1
33
+ </div>
34
+
35
+ <div class="col">
36
+ column2
37
+ </div>
38
+
39
+ <div class="col">
40
+ column3
41
+ </div>
42
+ </div>
43
+
44
+ <div class="container-4 fluid">
45
+ <div class="col">
46
+ column1
47
+ </div>
48
+
49
+ <div class="col">
50
+ column2
51
+ </div>
52
+
53
+ <div class="col">
54
+ column3
55
+ </div>
56
+
57
+ <div class="col">
58
+ column4
59
+ </div>
60
+ </div>
61
+
62
+ <div class="container-5 fluid">
63
+ <div class="col">
64
+ column1
65
+ </div>
66
+
67
+ <div class="col">
68
+ column2
69
+ </div>
70
+
71
+ <div class="col">
72
+ column3
73
+ </div>
74
+
75
+ <div class="col">
76
+ column4
77
+ </div>
78
+
79
+ <div class="col">
80
+ column5
81
+ </div>
82
+ </div>
83
+
84
+ <div class="container-2 fluid">
85
+ <div class="col r-3-2">
86
+ max
87
+ </div>
88
+
89
+ <div class="col r-3-1">
90
+ min
91
+ </div>
92
+ </div>
93
+
94
+ <div class="container-3 fluid">
95
+ <div class="col r-4-1">
96
+ min
97
+ </div>
98
+
99
+ <div class="col r-4-1">
100
+ min
101
+ </div>
102
+
103
+ <div class="col r-4-2">
104
+ max
105
+ </div>
106
+ </div>
107
+
108
+ <div class="container-3 fluid">
109
+ <div class="col r-5-1">
110
+ min
111
+ </div>
112
+
113
+ <div class="col r-5-3">
114
+ max
115
+ </div>
116
+
117
+ <div class="col r-5-1">
118
+ min
119
+ </div>
120
+ </div>
121
+
122
+ <div class="container fluid">
123
+ <h1>Constraining Containers</h1>
124
+ </div>
125
+
126
+ <div style="width:500px">
127
+ <div class="container-5 fluid">
128
+ <div class="col">
129
+ column1
130
+ </div>
131
+
132
+ <div class="col">
133
+ column2
134
+ </div>
135
+
136
+ <div class="col">
137
+ column3
138
+ </div>
139
+
140
+ <div class="col">
141
+ column4
142
+ </div>
143
+
144
+ <div class="col">
145
+ column5
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </body>
150
+ </html>