active_console 0.0.1 → 0.0.2

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: f2ea503f52056d41b16922192a50529d30c9e6f0
4
- data.tar.gz: 4d255afc9e07ffd0a7b3949eb4be7f2c97eeebd8
3
+ metadata.gz: a866eba928ab3cf071218ddfea8a5b00b45fed14
4
+ data.tar.gz: f8f0542f18aa8349a7c19047252853b9cfb688de
5
5
  SHA512:
6
- metadata.gz: 7c761dfb302b353e905154333ffd5a0ea7ee648db6f38fba29bc09ae367b91f125707c3f11431d3b1ae806431d5277ad6cb407722e57b7aca29336b65d8d27fa
7
- data.tar.gz: f7d0b924c3920785d9f1b085686e60f9734b74461d4b6bd6c72a8508f83ce78c2cf1dd525235fbd1615bba3ce65c9ae114409a1af4960e582f6cd367d6a83dc2
6
+ metadata.gz: 7a2a60b7afce609a31bf5e3b6062cc54f1ffbd98305fd862cfdddc803c97738c03c0ec3816ad6cdba27e89caf4e5e1e71b2e8122cdac54a199169a3b374afcb4
7
+ data.tar.gz: 70eaa8f20aaf6e548ccf50f3a0728697b8da263aceafc587fd1b66f96812c59ca3ba3f48abd929513329a33c9278de106a39db4991a9970f95de5020a1d2b134
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeconsole (0.0.1)
4
+ active_console (0.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -46,7 +46,7 @@ PLATFORMS
46
46
  ruby
47
47
 
48
48
  DEPENDENCIES
49
- activeconsole!
49
+ active_console!
50
50
  activerecord (~> 3.0)
51
51
  awesome_print
52
52
  bundler (~> 1.3)
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = [""]
11
11
  spec.description = %q{Improvements and shortcuts for Rails console}
12
12
  spec.summary = %q{Improvements and shortcuts for Rails console}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/jnsolutions/active_console"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -0,0 +1,5 @@
1
+ class ActiveConsole::ActiveConsoleArray < Array
2
+ #Do not monkey patch standard
3
+ #Array methods, this class is just here to group
4
+ #things better
5
+ end
@@ -0,0 +1,5 @@
1
+ class ActiveConsole::ActiveConsoleHash < Hash
2
+ #Do not monkey patch standard
3
+ #Hash methods, this class is just here to group
4
+ #things better
5
+ end
@@ -4,16 +4,16 @@ module Cols
4
4
  module ClassMethods
5
5
  def cols(list = "")
6
6
 
7
- matching_cols = []
7
+ matching_cols = ActiveConsole::ActiveConsoleArray.new
8
8
  searching_cols = list.split(",")
9
9
 
10
10
  columns.each do |col|
11
11
  if searching_cols.count > 0
12
12
  searching_cols.select do |c|
13
- matching_cols << Hash[col.name, col.sql_type] if col.name.match(/^#{c.strip}/)
13
+ matching_cols << ActiveConsole::ActiveConsoleHash[col.name, col.sql_type] if col.name.match(/^#{c.strip}/)
14
14
  end
15
15
  else
16
- matching_cols << Hash[col.name, col.sql_type]
16
+ matching_cols << ActiveConsole::ActiveConsoleHash[col.name, col.sql_type]
17
17
  end
18
18
  end
19
19
  matching_cols
@@ -11,7 +11,7 @@ module Rels
11
11
 
12
12
  private
13
13
  def display(rels)
14
- rels.map { |rel| Hash[rel.macro, rel.name].merge(rel.options) }
14
+ rels.map { |rel| Hash[rel.macro, rel.name].merge(rel.options) }
15
15
  end
16
16
 
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveConsole
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
Binary file
@@ -9,6 +9,14 @@ describe "model columns" do
9
9
  expect(User.cols.count).to eq(3)
10
10
  end
11
11
 
12
+ it "should return an array" do
13
+ expect(User.cols.class).to eq(ActiveConsole::ActiveConsoleArray)
14
+ end
15
+
16
+ it "should be a Hash Array" do
17
+ expect(User.cols.first.class).to eq(ActiveConsole::ActiveConsoleHash)
18
+ end
19
+
12
20
  end
13
21
 
14
22
  context "when passing arguments" do
@@ -10,6 +10,10 @@ describe "Rels" do
10
10
  it "should show the relationship" do
11
11
  expect(subject.rels).to eq(message)
12
12
  end
13
+
14
+ it "should return ActiveConsoleArray" do
15
+ expect(subject.rels.class).to eq(ActiveConsole::ActiveConsoleArray)
16
+ end
13
17
  end
14
18
 
15
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - morhekil
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-01-20 00:00:00.000000000 Z
16
+ date: 2014-01-29 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -127,6 +127,8 @@ files:
127
127
  - Rakefile
128
128
  - active_console.gemspec
129
129
  - lib/active_console.rb
130
+ - lib/active_console/active_console_array.rb
131
+ - lib/active_console/active_console_hash.rb
130
132
  - lib/active_console/agrep.rb
131
133
  - lib/active_console/alias.rb
132
134
  - lib/active_console/cols.rb
@@ -145,7 +147,7 @@ files:
145
147
  - spec/support/data.rb
146
148
  - spec/support/models.rb
147
149
  - spec/support/schema.rb
148
- homepage: ''
150
+ homepage: https://github.com/jnsolutions/active_console
149
151
  licenses:
150
152
  - MIT
151
153
  metadata: {}