use Gemfile.lock

This commit is contained in:
Seth Call 2017-12-17 20:26:20 -06:00
parent f3f888156b
commit 4f5bedd22c
8 changed files with 53 additions and 12 deletions

2
admin/.gitignore vendored
View File

@ -20,4 +20,4 @@ artifacts
*.iml
.idea
BUILD_NUMBER
Gemfile.lock
# Gemfile.lock

View File

@ -43,6 +43,8 @@ ActiveAdmin.register_page "POSA Card Uploads" do
redirect_to admin_posa_card_uploads_path, :notice => "Created #{array_of_arrays.length} POSA cards!"
end
end
=begin
@ -59,6 +61,45 @@ ActiveAdmin.register_page "POSA Card Uploads" do
f.actions
end
# fr manual entry of huge CSVs from rails c command line
PosaCard.transaction do
array_of_arrays = CSV.read('codes.csv')
array_of_arrays.each do |row|
if row.length != 5
raise "UKNONWN CSV FORMAT! Must be 5 columns"
end
code = row[0]
lesson_package_type = row[1]
preactivate = row[2].strip.downcase == "true"
requires_purchase = row[3].downcase== "true"
is_test = row[4].strip.downcase == "true"
posa_card = PosaCard.new
posa_card.code = code
posa_card.lesson_package_type = LessonPackageType.find(lesson_package_type)
posa_card.preactivate = preactivate
posa_card.requires_purchase = requires_purchase
posa_card.purchased = !requires_purchase
posa_card.card_type = 'jam_class_2'
posa_card.is_test = is_test
if posa_card.card_type == PosaCard::JAM_CLASS_4
posa_card.is_lesson = true
posa_card.credits = 4
elsif posa_card.card_type == PosaCard::JAM_CLASS_2
posa_card.is_lesson = true
posa_card.credits = 2
end
posa_card.origin = 'posa-cards-amazon-test-drive-paid-4-50k.csv'
posa_card.save!
end
end
=end
content do

View File

@ -23,7 +23,7 @@ cp ../ruby/jam_ruby-${GEM_VERSION}.gem vendor/cache/ || { echo "unable to copy j
# put all dependencies into vendor/bundle
#rm -rf vendor/bundle -- let jenkins config 'wipe workspace' decide this
rm Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
# rm Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
bundle install --path vendor/bundle
#bundle update

2
ruby/.gitignore vendored
View File

@ -3,7 +3,7 @@
.bundle
.config
.yardoc
Gemfile.lock
# Gemfile.lock
InstalledFiles
_yardoc
coverage

2
web/.gitignore vendored
View File

@ -29,7 +29,7 @@ jt_metadata.json
artifacts
Gemfile.lock
#Gemfile.lock
.sass-cache
log/development.log.age
log/test.log.age

View File

@ -11,7 +11,7 @@ mkdir $DIR/target/deb
#rm -rf vendor/bundle -- let jenkins config wipe workspace, or not
rm -rf tmp/capybara
rm -f Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
#rm -f Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
# put all dependencies into vendor/bundle
# default build number to 1 if not found

View File

@ -60,20 +60,20 @@ namespace :lessons do
task amazon_gift_cards: :environment do|task, args|
CSV.open("posa-cards-amazon-test-drive-paid-4.csv", "wb") do |csv|
for i in 1..250
csv << [generate(), 'amazon-test-drive-paid-4', true, true]
for i in 1..50000
csv << [generate(), 'amazon-test-drive-paid-4', true, true, false]
end
end
CSV.open("posa-cards-amazon-test-drive-free-4.csv", "wb") do |csv|
for i in 1..250
csv << [generate(), 'amazon-test-drive-free-4',true, false]
for i in 1..50000
csv << [generate(), 'amazon-test-drive-free-4',true, false, false]
end
end
CSV.open("posa-cards-amazon-test-drive-free-2.csv", "wb") do |csv|
for i in 1..250
csv << [generate(), 'amazon-test-drive-free-2',true, false]
for i in 1..50000
csv << [generate(), 'amazon-test-drive-free-2',true, false, false]
end
end
end

View File

@ -3,7 +3,7 @@
.bundle
.config
.yardoc
Gemfile.lock
#Gemfile.lock
InstalledFiles
_yardoc
coverage