a_series_of_tubes 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce7c7a7069aa5bbf7af4714d78016c27b41003e8
4
- data.tar.gz: 10e57327f16e1d948823b9f2564c2daf383788f3
3
+ metadata.gz: 1dc91bfe720e392510cb64ea9ff4c83d7eaadf4c
4
+ data.tar.gz: 46d79a43419784a9ac5bddf15cdb44aee3c50421
5
5
  SHA512:
6
- metadata.gz: a12c1280c2cca7faf14292b4a26f8007cb94ebde3319b0e5f525728fcec2c7b96bb6f59ac34ccaa377430b531b5d8fc3b6dd719fc333899ffb669f8ad0bfc414
7
- data.tar.gz: c9dc408b96ae0ecce17bccd717ea887f5e14abc82c8b675a577892efb94d6acfe3e128f8ca7c09099cf31af1e7d1a172d20a2fa92aedf591c6f9a5fb7e4cf2b6
6
+ metadata.gz: 1be9b67e8dc3639c7c029cd4f463e436fdc46957b7b887599e043d1f5781178a7adc5e83257b9096141d4bb331dd3075c8fc921da5b5fa59109c8446544a912e
7
+ data.tar.gz: d285cee2e1f6ebb30431b41f6a3c89193b6cec47c607d336d49003fd2c3933a3aabc4fe5a21654a77afa01e63f9240829d75017c0d37232f1c3ee026d0caad32
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- a_series_of_tubes (1.0.0)
4
+ a_series_of_tubes (1.0.1)
5
5
  json
6
6
  rack
7
7
 
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- # ASeriesOfTubes
1
+ # A Series Of Tubes
2
2
 
3
3
  This is a simple web development framework built in Ruby! It is currently under development, so stay tuned for more updates!
4
4
 
5
+ [Sample Server](http://www.github.com/danmakenoise/a_series_of_tubes_demo) | [Live Link](http://aseriesoftubes-demo.herokuapp.com)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -20,17 +22,62 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- TODO: Write usage instructions here
25
+ **A Series of Tubes** is a toolset for creating simple RESTful websites in Ruby. If you are interested in learning how to use it in your project, check out the [Sample Server](http://www.github.com/danmakenoise/a_series_of_tubes_demo) for a suggested application structure.
26
+
27
+ There are four main components to **A Series of Tubes**:
28
+
29
+ ### Tubes
30
+
31
+ Tubes are the individual routes users can navigate on your server. You can create a `Tube` via the `Tuber` class. An example set-up is as follows:
32
+
33
+ ```ruby
34
+ tuber = ASeriesOfTubes::Tubes::Tuber.new
35
+
36
+ tuber.draw do
37
+ get Regexp.new('^/$'), CatsController, :index
38
+ get Regexp.new('^/cats$'), CatsController, :index
39
+ get Regexp.new('^/cats/new$'), CatsController, :new
40
+ post Regexp.new('^/cats$'), CatsController, :create
41
+ end
42
+ ```
43
+
44
+ The `Tuber` itself is mainly useful as a means for creating the various instances of `Tube` using its `draw` function. Within `draw` you create a `Tube` with the following syntax:
45
+
46
+ ```ruby
47
+ METHOD REGEX_FOR_PATH, TUBE_CONTROLLER_NAME, TUBE_CONTROLLER_ACTIONS
48
+
49
+ # METHOD can be get, post, put, or delete
50
+ ```
51
+
52
+ ### TubeController
53
+
54
+ The `TubeController` is the class that will actually render your HTML/ERB views. For example, in our sample server, the `CatsController#index` action looks like this:
55
+
56
+ ```ruby
57
+ class CatsController < ASeriesOfTubes::TubeController
58
+ def index
59
+ @cats = get_cats_from_cookies
60
+ end
61
+
62
+ def get_cats_from_cookies
63
+ session['cats'] ? session['cats'] : []
64
+ end
65
+ end
66
+ ```
67
+
68
+ When a `Tube` gets matched to the `index` action, an instance variable `@cats` is created and is populated with any data in the session cookie under the key `cats`. This is another important feature of the `TubeController`! You can user `session[KEY]` to store data to the session cookies of the site. Similarly, there is `flash[KEY]` and `flash.now[KEY]`, which can be used to only store information for the next render or redirect.
69
+
70
+ ### TubeSupport
24
71
 
25
- ## Development
72
+ This module just contains helper functions for the entire gem.
26
73
 
27
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
74
+ ### TubeState
28
75
 
29
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
76
+ This module contains the internal workings of the `session` and `flash` abilities of the `TubeController` class.
30
77
 
31
78
  ## Contributing
32
79
 
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/rake-db-migrate/a_series_of_tubes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/danmakenoise/a_series_of_tubes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
34
81
 
35
82
 
36
83
  ## License
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["dan@danphillips.io"]
11
11
 
12
12
  spec.summary = "a web development framework"
13
- spec.homepage = "http://www.github.com/rake-db-migrate/a_series_of_tubes"
13
+ spec.homepage = "http://www.github.com/danmakenoise/a_series_of_tubes"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,3 +1,3 @@
1
1
  module ASeriesOfTubes
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a_series_of_tubes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Phillips
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,8 @@ files:
113
113
  - lib/a_series_of_tubes/tubes/tube.rb
114
114
  - lib/a_series_of_tubes/tubes/tuber.rb
115
115
  - lib/a_series_of_tubes/version.rb
116
- homepage: http://www.github.com/rake-db-migrate/a_series_of_tubes
116
+ - pkg/a_series_of_tubes-1.0.0.gem
117
+ homepage: http://www.github.com/danmakenoise/a_series_of_tubes
117
118
  licenses:
118
119
  - MIT
119
120
  metadata: {}