whales 0.1.2 → 0.1.3

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -0
  3. data/exe/whales +1 -2
  4. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 432eca4b7237146ea26c438eff7cff039ca635e9
4
- data.tar.gz: e992aeb760254fb76f380b1173f30872690fdba3
3
+ metadata.gz: a5f4db9db4245bd159062f4bd311e0d318f0be8f
4
+ data.tar.gz: 7661a2c7d3fcf6025f2e0f703bfcbc374bcd4b01
5
5
  SHA512:
6
- metadata.gz: 944668bed427b2e7fd759fe8cf8850e643f14006ebdad0c7158d78a9d2361a4a78ecb45155531aee707d73dbfda21cc405477d6bc885946b4839afd76320d2c4
7
- data.tar.gz: 99e73783ac7b24d4bbbc04ead603cca0f395fdb3e365ddd4bfd5a8edc5e0ad268785c19d26fc5bd071dd05b10669ab26434a149423b630cfb680af18db28afd3
6
+ metadata.gz: f992dcfd0370b5162622211ab1172a9270ab5d8af0d51ae32ca0e7ab02d76671f19fc55991aa8852e23f2baa9f6fa0b46013b9389e27532fe2b4178eace36ebd
7
+ data.tar.gz: 16278da4e2d6faa89c100132965da1827501d956b8fa0deb72ff14cf33c78ca1e3cc0aece2d21ec3c281c05529e0f86349acc1b792459a2af2d809e0bfc105cc
data/README.md CHANGED
@@ -26,3 +26,41 @@ cd MyApp
26
26
  # start the server
27
27
  whales server
28
28
  ```
29
+
30
+ ##Documentation##
31
+ ###WhalesORM###
32
+ WhalesORM is the object-relational mapper behind Whales. It connects to a SQLite
33
+ database that the user can create and modify in their `db/database.sql` file.
34
+
35
+ The features of WhalesORM are accessed by making a class that inherits from
36
+ `WhalesORM::Base`. The base class provides the following methods:
37
+
38
+ `::all`: returns all the instances of the class stored in the table.
39
+
40
+ `::columns`: returns an array with the columns of the class's table.
41
+
42
+ `::destroy_all`: deletes all the rows in the class's table.
43
+
44
+ `::find(id)`: returns the object of the class with the given id.
45
+
46
+ `::find_by_col_x(value)`: returns the object(s) of the class whose `col_x` equals `value`. Implemented using Ruby's `method_missing`. Also can be extended to
47
+ `::find_by_col_x_and_col_y(val_x, val_y)`.
48
+
49
+ `::table_name=(name)`: allows the user to set a custom table name for the class
50
+
51
+ `::table_name`: returns the table name, which defaults to the pluralized,
52
+ camel-cased class name.
53
+
54
+
55
+ `#attributes`: returns the names of all the attributes for the object.
56
+
57
+ `#attribute_values`: returns the values for all the object's attributes.
58
+
59
+ `#destroy`: deletes the object from the database. Returns the object.
60
+
61
+ `#insert`: inserts the object as a row in the class's table
62
+
63
+ `#save`: if the object is not in the database, it `insert`s it; if it is, it calls
64
+ `update`.
65
+
66
+ `#update`: updates the object's entry in the database
data/exe/whales CHANGED
@@ -77,8 +77,7 @@ when 'new'
77
77
  mkdir 'models', display
78
78
  mkdir 'views'
79
79
  when "server" || "s"
80
- puts $LOAD_PATH
81
- require_relative "../../whales_app/routes"
80
+ require_relative pwd + "/routes"
82
81
  require_relative "../server"
83
82
  start_server(make_router)
84
83
  when 'generate' || 'g'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Horton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-13 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.2
47
+ version: 0.1.3
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
- version: 0.1.2
54
+ version: 0.1.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: whales_orm
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.2
61
+ version: 0.1.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.2
68
+ version: 0.1.3
69
69
  description:
70
70
  email:
71
71
  - wdt.horton@gmail.com
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.5.0
99
+ rubygems_version: 2.5.1
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: A full-stack MVC framework in Ruby