acts_as_learnable 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86e3584db9d1a037dab37f71a7df1d39c972ba9d
4
- data.tar.gz: 02bcf836c5fd6aad46e7dc2460b6faee756e3ab1
3
+ metadata.gz: 9da5b966e48e9b1c72f0bd09c4ecfa368c741701
4
+ data.tar.gz: 1aeee4b6a3cef0942f695d1ab36e7ae10fc8cb7f
5
5
  SHA512:
6
- metadata.gz: 21d5057b3b65965c04030f642614ceae86835a8af754a14ef16dc26160d945e849e3fb9b8f952830b733aa2fa7862c91d85eeb597c7e6bd07709912b7ee3446e
7
- data.tar.gz: 89344674ce8df5c427e70b07fd8e16b98ff48daac669277283c69a3039f658cba84746ba008327d395a9c297cb0ae7e257a9d7a402eb4bf84eb3f24fd8c9575f
6
+ metadata.gz: 987b9f12e12b96188cc242c44df43d123b5e7fdd3b65c5fa47ff848f67ad6326d9722b84688e5636cb49cc562b0529ead589cd2dce1e307338e4145cdcedc1f1
7
+ data.tar.gz: 6a588898060364332170aa0afeb91824c4ea5e72ca52e55b01aba0d5d511cfab84e8d7b74b6e1fdb1265b5d11f9ee0477541471a8d62ba23188f2e1354b58aa0
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.3.4
5
+ - 2.4.1
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # ActsAsLearnable
2
2
 
3
+ [![Build Status](https://img.shields.io/travis/dankimio/acts_as_learnable.svg?style=flat)](https://travis-ci.org/dankimio/acts_as_learnable)
4
+ [![Gem Version](https://img.shields.io/gem/v/acts_as_learnable.svg?style=flat&color=brightgreen)](https://rubygems.org/gems/acts_as_learnable)
5
+ [![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://dankimio.mit-license.org)
6
+
7
+
3
8
  ActsAsLearnable is a Ruby gem for ActiveRecord models. It provides a simple way to create flashcards in your app. It automatically schedules flashcards for review depending on recall quality (1 to 5). You can easily create a Spaced Repetition System (SRS) using this gem. Flashcards are scheduled using SuperMemo 2 algorithm.
4
9
 
5
10
  ## Installation
@@ -35,9 +40,7 @@ end
35
40
 
36
41
  It will automatically extend your class with all necessary methods.
37
42
 
38
- Make sure you have the following fields on the model (generators will be added later):
39
-
40
- Then you can review items:
43
+ Then you can review flashcards:
41
44
 
42
45
  ```ruby
43
46
  card = Flashcard.create
@@ -59,5 +62,5 @@ card.repetitions # => 1
59
62
 
60
63
  ## TODO
61
64
 
62
- * More detailed README
63
- * Other repetition algorithms (Anki)
65
+ - [ ] More detailed README
66
+ - [ ] Other repetition algorithms (Anki)
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'bundler/gem_tasks'
1
2
  require 'rake/testtask'
2
3
 
3
4
  Rake::TestTask.new do |t|
@@ -6,23 +6,23 @@ require 'acts_as_learnable/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'acts_as_learnable'
8
8
  spec.version = ActsAsLearnable::VERSION
9
- spec.authors = ['Danya Kim']
10
- spec.email = ["itsdanya@gmail.com"]
9
+ spec.authors = ['Dan Kim']
10
+ spec.email = ['itsdanya@gmail.com']
11
11
  spec.summary = 'A simple way to create flashcards in your app.'
12
12
  spec.description = 'ActsAsLearnable is a Ruby gem for ActiveRecord models. It provides a simple way to create flashcards in your app. It automatically schedules flashcards for review depending on recall quality (1 to 5). You can easily create a Spaced Repetition System (SRS) using this gem.'
13
- spec.homepage = 'http://github.com/itsdan/acts_as_learnable'
14
- spec.license = "MIT"
13
+ spec.homepage = 'https://github.com/itsdn/acts_as_learnable'
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'activerecord', '~> 4.0'
22
- spec.add_dependency 'activesupport', '~> 4.0'
21
+ spec.add_dependency 'activerecord', '>= 4.2'
22
+ spec.add_dependency 'activesupport', '>= 4.2'
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.7'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'sqlite3', '~> 1.3'
27
- spec.add_development_dependency 'byebug', '~> 4.0'
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'sqlite3'
27
+ spec.add_development_dependency 'byebug'
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsLearnable
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -9,13 +9,16 @@ class FlashcardGenerator < ActiveRecord::Generators::Base
9
9
  source_root File.expand_path('../templates', __FILE__)
10
10
 
11
11
  def install_flashcards
12
- if File.exist?("#{destination_root}/db/schema.rb") &&
13
- File.read("#{destination_root}/db/schema.rb") =~ /create_table \"#{table_name}\"/
14
- migration_template(
15
- 'add_fields_migration.rb',
16
- "db/migrate/add_flashcard_fields_to_#{table_name}.rb")
12
+ if schema_exists? && File.read("#{destination_root}/db/schema.rb") =~ /create_table \"#{table_name}\"/
13
+ migration_template('add_fields_migration.rb', "db/migrate/add_flashcard_fields_to_#{table_name}.rb")
17
14
  else
18
15
  migration_template('create_table_migration.rb', "db/migrate/create_#{table_name}.rb")
19
16
  end
20
17
  end
18
+
19
+ private
20
+
21
+ def schema_exists?
22
+ File.exist?("#{destination_root}/db/schema.rb")
23
+ end
21
24
  end
@@ -1,17 +1,9 @@
1
1
  class <%= @migration_class_name %> < ActiveRecord::Migration
2
- def self.up
2
+ def change
3
3
  add_column :<%= table_name %>, :easiness_factor, :float, default: 2.5
4
- add_column :<%= table_name %>, :repetitions, :integer, default: 0
5
- add_column :<%= table_name %>, :interval, :integer, default: 0
6
- add_column :<%= table_name %>, :due, :date, default: nil
7
- add_column :<%= table_name %>, :studied_at, :date, default: nil
8
- end
9
-
10
- def self.down
11
- remove_column :<%= table_name %>, :easiness_factor
12
- remove_column :<%= table_name %>, :repetitions
13
- remove_column :<%= table_name %>, :interval
14
- remove_column :<%= table_name %>, :due
15
- remove_column :<%= table_name %>, :studied_at
4
+ add_column :<%= table_name %>, :repetitions, :integer, default: 0
5
+ add_column :<%= table_name %>, :interval, :integer, default: 0
6
+ add_column :<%= table_name %>, :due, :date, default: nil
7
+ add_column :<%= table_name %>, :studied_at, :date, default: nil
16
8
  end
17
9
  end
@@ -1,15 +1,11 @@
1
1
  class <%= @migration_class_name %> < ActiveRecord::Migration
2
- def self.up
3
- create_table '<%= table_name %>' do |t|
4
- t.column :easiness_factor, :float, default: 2.5
5
- t.column :repetitions, :integer, default: 0
6
- t.column :interval, :integer, default: 0
7
- t.column :due, :date, default: nil
8
- t.column :studied_at, :date, default: nil
2
+ def change
3
+ create_table :<%= table_name %> do |t|
4
+ t.column :easiness_factor, :float, default: 2.5
5
+ t.column :repetitions, :integer, default: 0
6
+ t.column :interval, :integer, default: 0
7
+ t.column :due, :date, default: nil
8
+ t.column :studied_at, :date, default: nil
9
9
  end
10
10
  end
11
-
12
- def self.down
13
- drop_table '<%= table_name %>'
14
- end
15
11
  end
@@ -18,7 +18,7 @@ def setup_db
18
18
  end
19
19
 
20
20
  def teardown_db
21
- ActiveRecord::Base.connection.tables.each do |table|
21
+ ActiveRecord::Base.connection.data_sources.each do |table|
22
22
  ActiveRecord::Base.connection.drop_table(table)
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_learnable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Danya Kim
7
+ - Dan Kim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
33
+ version: '4.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '4.0'
40
+ version: '4.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.7'
47
+ version: '0'
48
48
  type: :development
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: '1.7'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
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: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.3'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: byebug
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '4.0'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '4.0'
96
+ version: '0'
97
97
  description: ActsAsLearnable is a Ruby gem for ActiveRecord models. It provides a
98
98
  simple way to create flashcards in your app. It automatically schedules flashcards
99
99
  for review depending on recall quality (1 to 5). You can easily create a Spaced
@@ -105,6 +105,7 @@ extensions: []
105
105
  extra_rdoc_files: []
106
106
  files:
107
107
  - ".gitignore"
108
+ - ".travis.yml"
108
109
  - Gemfile
109
110
  - LICENSE.txt
110
111
  - README.md
@@ -118,7 +119,7 @@ files:
118
119
  - lib/generators/flashcard/templates/create_table_migration.rb
119
120
  - test/test_base.rb
120
121
  - test/test_helper.rb
121
- homepage: http://github.com/itsdan/acts_as_learnable
122
+ homepage: https://github.com/itsdn/acts_as_learnable
122
123
  licenses:
123
124
  - MIT
124
125
  metadata: {}
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  version: '0'
139
140
  requirements: []
140
141
  rubyforge_project:
141
- rubygems_version: 2.4.5
142
+ rubygems_version: 2.6.11
142
143
  signing_key:
143
144
  specification_version: 4
144
145
  summary: A simple way to create flashcards in your app.