admin_script 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -10
  3. data/lib/admin_script/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df6168235a7250a58c485f7258f0a9afd740fa44
4
- data.tar.gz: 394fca419eb6bde355a249c9a7490ec0c9407035
3
+ metadata.gz: 6896a7b9f199e0bad27a3c74c51236187c1b78ed
4
+ data.tar.gz: bce7de9612f83468c84b192925b1c29b0f93cf3f
5
5
  SHA512:
6
- metadata.gz: f984af47819c63dc7171bd5d16e9cd3a5b78949ec0998da33ac9764c0413068c3176ba93aa89fb6efa196f423465d815571ed359691420390fc0ffd98900e1fe
7
- data.tar.gz: e9dde467264cd8ea5bcf3a8730967034b02b8650373ac2ecfce8d1b2c2c76b6f62e9ea8cfac31d8d285e3ff7c422aaea0d90fdb58e1c97288af37884acee3b4d
6
+ metadata.gz: 95472949ff568ad9ddf55aff322277c539dcaa2af9a4f165f6a5616a722a4f3ec47d058b0888aeda78b2fad9dca7739291107f1f50cca110f313a5e96def3618
7
+ data.tar.gz: 1909f98e4c6d9e55722d59666d5c1b0a7a4062046e0f3b8f297fe5c5ab6dc4891a9bae8a54e2fdccd4b7fd336242929fa48d9249158cb03418821f000fe3495b
data/README.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # AdminScript
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/admin_script.png)](http://badge.fury.io/rb/admin\_extractor)
3
+ [![Gem Version](https://badge.fury.io/rb/admin_script.png)](http://badge.fury.io/rb/admin\_script)
4
4
  [![Build Status](https://travis-ci.org/alpaca-tc/admin_script.svg?branch=master)](https://travis-ci.org/alpaca-tc/admin\_script)
5
5
 
6
- A module for creating flexible, simple scripts for project in Rails.
6
+ A module that creates flexible, simple scripts for Rails project.
7
7
 
8
8
  <img width="1147" alt="edit_page_example" src="https://cloud.githubusercontent.com/assets/1688137/21744577/cd1d3bac-d55b-11e6-8a9d-bda96edd4d36.png">
9
9
 
10
- ## Why use an AdminScript?
10
+ ## Why use AdminScript?
11
11
 
12
- I do not want to design RESTful resource for such scripts that run only a few times a month.
13
- A new template is also a complete waste of time.
12
+ Sometimes we add a button to admin panel to run automated script, but I do not want to design RESTful resource and create new template for such scripts.
14
13
 
15
- Therefore, AdminScript provides management page of scripts.
16
- Only once to define model to perform a script, it generates template automatically.
17
- No configuration of routing, controller and template.
14
+ `AdminScript` provides a page of manage these scripts.
15
+
16
+ **All you have to do is adding a script.**
17
+ No configuration of routing, controller or template.
18
18
 
19
19
  ## Getting Started
20
20
 
@@ -30,7 +30,7 @@ Re-bundle, then run the installer:
30
30
  $ bundle exec rails generate admin_script:install
31
31
  ```
32
32
 
33
- AdminScript provides a rails engine that can display listing of your scripts.
33
+ AdminScript provides a Rails engine that can display form of AdminScript.
34
34
  Add the following to your `config/routes.rb`
35
35
 
36
36
  ```
@@ -39,7 +39,7 @@ mount AdminScript::Engine => '/admin_scripts'
39
39
 
40
40
  ### Generators
41
41
 
42
- When you have AdminScript installed
42
+ When you have AdminScript installed, you can run...
43
43
 
44
44
  ```
45
45
  bundle exec rails generate admin_script:model awesome_script id:integer body:text
@@ -47,6 +47,29 @@ bundle exec rails generate admin_script:model awesome_script id:integer body:tex
47
47
 
48
48
  ...to create the `AdminScript::AwesomeScript`.
49
49
 
50
+ ### Example
51
+
52
+ ```
53
+ # app/models/admin_script/awesome_script.rb
54
+ class AdminScript::AwesomeScript < AdminScript::Base
55
+ # Define attribute name and type
56
+ type_attribute :id, :integer
57
+
58
+ def perform
59
+ return false unless valid?
60
+
61
+ # do something
62
+
63
+ true
64
+ end
65
+ end
66
+
67
+ # app/views/*.html.erb
68
+ <%= link_to 'All Scripts', AdminScript.railtie_routes_url_helpers.admin_scripts_path %>
69
+ <%= link_to 'Show Form', AdminScript.railtie_routes_url_helpers.admin_script_path(AdminScript::AwesomeScript, admin_script: { id: '1' }) %>
70
+ <%= link_to 'Perform Script', AdminScript.railtie_routes_url_helpers.edit_admin_script_path(AdminScript::AwesomeScript, admin_script: { id: '1' }), data: { method: :put } %>
71
+ ```
72
+
50
73
  ## Development
51
74
 
52
75
  no doc
@@ -1,3 +1,3 @@
1
1
  module AdminScript
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_script
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - alpaca-tc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-08 00:00:00.000000000 Z
11
+ date: 2017-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails