ez 0.6.3 → 0.6.4
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 +4 -4
- data/README.md +31 -9
- data/lib/ez/version.rb +1 -1
- data/lib/ez/view_helpers.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d07560a673e27d9fe1febfcb203ba24ca2b7ba87
|
4
|
+
data.tar.gz: 83ebebb1d7c3957cd24a0605ea524826f8902245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77b7063daf7e9de55741a8bf19f9bff54c1cf43bdde3316c49e635ccecb27af9ebaf0a5b0d70da2f6f84884176fabccef48ee3829a54c46f30dacd7559c51c58
|
7
|
+
data.tar.gz: e0ecd896448689fa7a6fc56dad1145b638152886d6c15d5bda71063d1414032fd028fac4e8923761c3a46575e41e0894d0372c54f314bf106cd40e7417abf8cc
|
data/README.md
CHANGED
@@ -1,16 +1,38 @@
|
|
1
1
|
# EZ
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
For educational purposes only. Makes Rails a bit more beginner-friendly.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'ez', group: 'development'
|
9
|
+
```
|
10
|
+
|
11
|
+
## Features
|
12
|
+
|
13
|
+
### 1. Console Enhancements
|
14
|
+
|
15
|
+
* Fixes the "no connection" message in Rails >= 4.0.1 (if you try to inspect a model without making a query first) by establishing an initial connection to the development database.
|
16
|
+
* Shows helpful instructions when console starts, including the list of model classes found in the application.
|
17
|
+
* Uses Hirb for table-like display. (Depends on Hirb ~> 0.7.1)
|
18
|
+
* Patches Hirb to allow nice table output for `ActiveRecord::Relation` lists (i.e. result of `.all`, `.where`) and hash-like output for single ActiveRecord objects, such as the result of `.find_by(:title => 'Apollo 13')`.
|
19
|
+
|
20
|
+
### 2. Route Enhancements
|
21
|
+
|
5
22
|
* Patches the Rails dispatcher to avoid writing controllers for simple views by adding route support for `get "url" => "folder/file"`
|
6
|
-
* Enables instant modeling without migrations via `models.yml` and `rake ez:tables`
|
7
|
-
* Quick JSON API calls with `EZ.from_api(url)`, returns parsed Ruby hash (or array, etc.)
|
8
|
-
* Built-in `EZ.weather(location)` for classroom demo of API, to get quick hash and avoid JSON explanation. Relies on http://openweathermap.org
|
9
|
-
* Adds controller and view helpers `current_user`, `user_signed_in?`, `sign_in_as`, and `sign_out` to avoid cookies/session hash details
|
10
|
-
* Adds ActiveRecord::Base `read` method to provide symmetry with `create`, `update`, and `delete`
|
11
|
-
* Adds ActiveRecord::Base `sample` method to choose a random row
|
12
|
-
* Patches Hirb to allow table output for `ActiveRecord::Relation` lists (i.e. result of `.all`, `.where` or `.read(:col => value)` but normal output for single ActiveRecord objects, like the result of `.find_by(:id => id)` or `read(id)`
|
13
23
|
|
24
|
+
### 3. Model Enhancements
|
25
|
+
|
26
|
+
* Enables instant modeling without migrations via `models.yml` and `rake ez:tables`. If things get messed up, use `rake ez:reset_tables` to drop the entire db first.
|
27
|
+
* Adds ActiveRecord::Base `.read` method to provide symmetry with `.create`, `.update`, and `.delete`
|
28
|
+
* Adds ActiveRecord::Base `.sample` method to choose a random row
|
29
|
+
|
30
|
+
### 4. Controller and View Enhancements
|
31
|
+
|
32
|
+
* Easier JSON API calls by calling `EZ.from_api(url)`; returns parsed Ruby hash (or array, etc.)
|
33
|
+
* Built-in view helper `<%= weather %>` and `EZ.weather` for classroom demo of a JSON API, to get quick hash and avoid gory details. (Relies on http://openweathermap.org). Default location is Evanston. Can pass location: `<%= weather('San Diego, CA') %>`. The `<%= weather %>` helper just delegates to `EZ.weather`.
|
34
|
+
* Adds controller and view helpers `current_user`, `user_signed_in?`, `sign_in_as`, and `sign_out` to avoid cookies/session hash details
|
35
|
+
* Adds view helper `map` to display a quick static map of any address. Example: `<%= map('Millenium Park, Chicago, IL') %>`
|
14
36
|
|
15
37
|
|
16
38
|
|
data/lib/ez/version.rb
CHANGED
data/lib/ez/view_helpers.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
module EZ
|
2
2
|
module ViewHelpers
|
3
3
|
|
4
|
+
def weather(location = 'Evanston, IL')
|
5
|
+
EZ.weather(location)
|
6
|
+
end
|
7
|
+
|
4
8
|
def map(location, options = {})
|
5
9
|
defaults = { :zoom => 12, :scale => 1, :size => '400x400', :type => 'hybrid', :sensor => false}
|
6
10
|
parameters = defaults.merge(options)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Cohen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hirb
|